From 80ea45831bc1c5a4ebbd60cb1d05d274e2612f6d Mon Sep 17 00:00:00 2001 From: "sumathi.thirumani" Date: Thu, 18 Jan 2024 14:20:00 -0800 Subject: [PATCH] Sync from dev. --- request-management-api/request_api/services/events/oipc.py | 6 ++++-- request-management-api/request_api/services/eventservice.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/request-management-api/request_api/services/events/oipc.py b/request-management-api/request_api/services/events/oipc.py index a440a1104..df3305dec 100644 --- a/request-management-api/request_api/services/events/oipc.py +++ b/request-management-api/request_api/services/events/oipc.py @@ -18,11 +18,13 @@ class oipcevent: """ FOI OIPC Event management service """ - def createoipcevent(self, requestid, userid): + def createoipcevent(self, requestid, requesttype, userid): + if requesttype != "ministryrequest": + return DefaultMethodResult(True,'No change',requestid) ministryrequest = FOIMinistryRequest.getmetadata(requestid) if ministryrequest["isoipcreview"] in (None, False): notificationservice().dismissnotifications_by_requestid_type(requestid, "ministryrequest", self.__notificationtype()) - return DefaultMethodResult(True,'No change',requestid) + return DefaultMethodResult(True,'Dismiss OIPC events',requestid) inquiryoutcomes = oipcservice().getinquiryoutcomes() version = ministryrequest["version"] curoipcs = FOIRequestOIPC.getoipc(requestid, version) diff --git a/request-management-api/request_api/services/eventservice.py b/request-management-api/request_api/services/eventservice.py index 614cd4351..96ba48dcc 100644 --- a/request-management-api/request_api/services/eventservice.py +++ b/request-management-api/request_api/services/eventservice.py @@ -36,7 +36,7 @@ def posteventsync(self, requestid, requesttype, userid, username, isministryuser stateeventresponse = stateevent().createstatetransitionevent(requestid, requesttype, userid, username) divisioneventresponse = divisionevent().createdivisionevent(requestid, requesttype, userid) assignmentresponse = assignmentevent().createassignmentevent(requestid, requesttype, userid, isministryuser,assigneename,username) - oipcresponse = oipcevent().createoipcevent(requestid, userid) + oipcresponse = oipcevent().createoipcevent(requestid, requesttype, userid) if stateeventresponse.success == False or divisioneventresponse.success == False or assignmentresponse.success == False or oipcresponse.success == False: current_app.logger.error("FOI Notification failed for event for request= %s ; state response=%s ; division response=%s ; assignment response=%s ; oipc response=%s" % (requestid, stateeventresponse.message, divisioneventresponse.message, assignmentresponse.message, oipcresponse.message)) except BusinessException as exception: