Commit 1ac71223 by David Ormsbee

Merge pull request #979 from edx/ormsbee/ss_small_fixes

Send JSON messages to Software Secure in UTF-8, without escaping
parents 15b3b9ad 8c056f38
...@@ -500,7 +500,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification): ...@@ -500,7 +500,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
header_txt = "\n".join( header_txt = "\n".join(
"{}: {}".format(h, v) for h,v in sorted(headers.items()) "{}: {}".format(h, v) for h,v in sorted(headers.items())
) )
body_txt = json.dumps(body, indent=2, sort_keys=True) body_txt = json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False)
return header_txt + "\n\n" + body_txt return header_txt + "\n\n" + body_txt
...@@ -509,7 +509,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification): ...@@ -509,7 +509,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
response = requests.post( response = requests.post(
settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["API_URL"], settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["API_URL"],
headers=headers, headers=headers,
data=json.dumps(body, indent=2, sort_keys=True) data=json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False)
) )
log.debug("Sent request to Software Secure for {}".format(self.receipt_id)) log.debug("Sent request to Software Secure for {}".format(self.receipt_id))
log.debug("Headers:\n{}\n\n".format(headers)) 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