From 8c056f383eb89f8f1683148bcd97a43ee1d513e6 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Fri, 13 Sep 2013 15:20:08 -0400 Subject: [PATCH] Make sure our JSON messages output unescaped UTF-8 text, to match Software Secure expectations. --- lms/djangoapps/verify_student/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py index c35a1cb2a3..a7f1caaca7 100644 --- a/lms/djangoapps/verify_student/models.py +++ b/lms/djangoapps/verify_student/models.py @@ -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) + body_txt = json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False) 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) + 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("Headers:\n{}\n\n".format(headers))