Commit 3b44ec11 by David Ormsbee

Convert JSON dumps output to UTF-8 before sending to Software Secure

parent 89a4737d
......@@ -500,7 +500,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
header_txt = "\n".join(
"{}: {}".format(h, v) for h,v in sorted(headers.items())
)
body_txt = json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False)
body_txt = json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False).encode('utf-8')
return header_txt + "\n\n" + body_txt
......@@ -509,7 +509,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
response = requests.post(
settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["API_URL"],
headers=headers,
data=json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False)
data=json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False).encode('utf-8')
)
log.debug("Sent request to Software Secure for {}".format(self.receipt_id))
log.debug("Headers:\n{}\n\n".format(headers))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment