diff --git a/request-management-api/request_api/services/requestservice.py b/request-management-api/request_api/services/requestservice.py index e8a23c20a..09dc3d766 100644 --- a/request-management-api/request_api/services/requestservice.py +++ b/request-management-api/request_api/services/requestservice.py @@ -62,9 +62,15 @@ def saverequest( ) def saverequestversion(self, foirequestschema, foirequestid, ministryid, userid): - nextstatename = FOIRequestStatus.getrequeststatusname( + nextstate = FOIRequestStatus.getrequeststatusname( foirequestschema["requeststatusid"] ) + nextstatename = ( + nextstate.get("name") + if isinstance(nextstatename, dict) + and nextstatename.get("name") not in (None, "") + else "" + ) rev_foirequestschema = self.updateduedate( foirequestid, ministryid, @@ -281,7 +287,7 @@ def __skipduedatecalculation( currentstatus not in (None, "") and currentstatus == StateName.onhold.value and nextstatename not in (None, "") - and currentstatus == nextstatename["name"] + and currentstatus == nextstatename ): return True if previousoffholddate not in (None, ""):