Skip to content

Commit

Permalink
Merge pull request #5298 from bcgov/dev-NK-FOIMOD-3205
Browse files Browse the repository at this point in the history
fix recordspagecount and axislanpagecount not being copied over durin…
  • Loading branch information
nkan-aot2 authored Jun 26, 2024
2 parents de89e1e + c9cba48 commit 045d6a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class Meta: # pylint: disable=too-few-public-methods

oipcdetails = fields.Nested(FOIMinistryRequestOIPCSchema, many=True,allow_none=True)

recordspagecount = fields.Int(data_key="recordspagecount",allow_none=True)
axislanpagecount = fields.Int(data_key="axislanpagecount",allow_none=True)

class EditableFOIMinistryRequestWrapperSchema(Schema):
class Meta: # pylint: disable=too-few-public-methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def createministry(self, requestschema, ministry, activeversion, userid, filenum
foiministryrequest.axisrequestid = requestschema.get("axisRequestId")
foiministryrequest.axissyncdate = requestschema.get("axisSyncDate")
foiministryrequest.axispagecount = requestschema.get("axispagecount")
foiministryrequest.axislanpagecount = requestschema.get("axislanpagecount")
foiministryrequest.recordspagecount = requestschema.get("recordspagecount")
foiministryrequest.filenumber = self.generatefilenumber(ministry["code"], requestschema.get("foirawrequestid")) if filenumber is None else filenumber
foiministryrequest.programareaid = self.getvalueof("programArea",ministry["code"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def __preparebaseinfo(self,request,foiministryrequestid,requestministry,requestm
'axisSyncDate': parse(requestministry["axissyncdate"]).strftime('%Y-%m-%d %H:%M:%S.%f') if axissyncdatenoneorempty == False else None,
'axispagecount': int(requestministry["axispagecount"]) if requestministry["axispagecount"] is not None else 0 ,
'recordspagecount': int(requestministry["recordspagecount"]) if requestministry["recordspagecount"] is not None else 0 ,
'axislanpagecount': int(requestministry["axislanpagecount"]) if requestministry["axislanpagecount"] is not None else 0 ,
'description': requestministry['description'],
'fromDate': parse(requestministry['recordsearchfromdate']).strftime(self.__genericdateformat()) if requestministry['recordsearchfromdate'] is not None else '',
'toDate': parse(requestministry['recordsearchtodate']).strftime(self.__genericdateformat()) if requestministry['recordsearchtodate'] is not None else '',
Expand Down

0 comments on commit 045d6a3

Please sign in to comment.