Skip to content

Commit

Permalink
fix for nextstatename check
Browse files Browse the repository at this point in the history
  • Loading branch information
divyav-aot committed Nov 15, 2023
1 parent 9961af5 commit 3718696
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions request-management-api/request_api/services/requestservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -280,9 +286,8 @@ def __skipduedatecalculation(
if (
currentstatus not in (None, "")
and currentstatus == StateName.onhold.value
and isinstance(nextstatename, dict)
and nextstatename.get("name") not in (None, "")
and currentstatus == nextstatename.get("name")
and nextstatename not in (None, "")
and currentstatus == nextstatename
):
return True
if previousoffholddate not in (None, ""):
Expand Down

0 comments on commit 3718696

Please sign in to comment.