Skip to content

Commit

Permalink
CFR notification for watcher: fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
divyav-aot committed Jan 17, 2024
1 parent 4082abb commit 535aaac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion request-management-api/request_api/services/events/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def __createnotification(self, requestid, state, requesttype, userid):
if state == StateName.callforrecords.value and requesttype == "ministryrequest":
foirequest = notificationservice().getrequest(requestid, requesttype)
_notificationtype = "Group Members" if foirequest['assignedministryperson'] is None else "State"
notificationtype = NotificationType().getnotificationtypeid(_notificationtype)
notification = self.__preparenotification(state)
if state == StateName.response.value and requesttype == "ministryrequest":
signgoffapproval = FOIMinistryRequest().getrequest(requestid)['ministrysignoffapproval']
Expand All @@ -74,10 +73,13 @@ def __createnotification(self, requestid, state, requesttype, userid):
if state == StateName.archived.value:
_openedministries = FOIMinistryRequest.getministriesopenedbyuid(requestid)
for ministry in _openedministries:
notificationtype = NotificationType().getnotificationtypeid("State")
response = notificationservice().createnotification({"message" : notification}, ministry["ministryrequestid"], 'ministryrequest', notificationtype, userid)
else:
notificationtype = NotificationType().getnotificationtypeid("State")
response = notificationservice().createnotification({"message" : notification}, requestid, requesttype, notificationtype, userid)
if _notificationtype == "Group Members":
notificationtype = NotificationType().getnotificationtypeid(_notificationtype)
notification = self.__preparegroupmembernotification(state, requestid)
groupmemberresponse = notificationservice().createnotification({"message" : notification}, requestid, requesttype, notificationtype, userid)
if response.success == True and groupmemberresponse.success == True :
Expand Down

0 comments on commit 535aaac

Please sign in to comment.