Skip to content

Commit

Permalink
Merge pull request #5023 from bcgov/dev-ST-FOIMOD-2894
Browse files Browse the repository at this point in the history
changes to fix json datetime issue.
  • Loading branch information
sumathi-thirumani authored Jan 25, 2024
2 parents d87a1fd + d7a4604 commit bf3bbbd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def getstatesummary(cls, ministryrequestid):
_tmp_state = None
for row in rs:
if row["status"] != _tmp_state:
transitions.append({"status": row["status"], "version": row["version"], "created_at": row["created_at"]})
transitions.append({"status": row["status"], "version": row["version"], "created_at": row["created_at"].strftime('%Y-%m-%d %H:%M:%S.%f')})
_tmp_state = row["status"]
except Exception as ex:
logging.error(ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def generate_receipt(self, template_hash_code: str, data):
},
"data": data
}
json_request_body = json.dumps(request_body, default = str)
json_request_body = json.dumps(request_body)

headers = {
'Content-Type': 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class senderservice:
"""

def send(self, servicekey, content, _messageattachmentlist, requestjson):
#logging.debug("Begin: Send email for request = "+json.dumps(requestjson))
logging.debug("Begin: Send email for request = "+json.dumps(requestjson))
msg = MIMEMultipart()
msg['From'] = MAIL_FROM_ADDRESS
msg['To'] = requestjson["email"]
Expand All @@ -56,7 +56,7 @@ def send(self, servicekey, content, _messageattachmentlist, requestjson):
#smtpobj.login(MAIL_SRV_USERID, MAIL_SRV_PASSWORD)
smtpobj.sendmail(msg['From'], msg['To'], msg.as_string())
smtpobj.quit()
#logging.debug("End: Send email for request = "+json.dumps(requestjson))
logging.debug("End: Send email for request = "+json.dumps(requestjson))
return {"success" : True, "message": "Sent successfully"}
except Exception as e:
logging.exception(e)
Expand Down

0 comments on commit bf3bbbd

Please sign in to comment.