Commit ee6306d6 by Chris Dodge

add some unicode protection

parent 80b8b5a2
...@@ -73,13 +73,14 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider): ...@@ -73,13 +73,14 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
if status not in [200, 201]: if status not in [200, 201]:
err_msg = ( err_msg = (
'Could not register attempt_code = {attempt_code}. ' u'Could not register attempt_code = {attempt_code}. '
'HTTP Status code was {status_code} and response was {response}.'.format( 'HTTP Status code was {status_code} and response was {response}.'.format(
attempt_code=attempt_code, attempt_code=attempt_code,
status_code=status, status_code=status,
response=response response=response
) )
) )
log.error(err_msg)
raise BackendProvideCannotRegisterAttempt(err_msg) raise BackendProvideCannotRegisterAttempt(err_msg)
# get the external ID that Software Secure has defined # get the external ID that Software Secure has defined
......
...@@ -531,7 +531,7 @@ class StudentProctoredExamAttemptCollection(AuthenticatedAPIView): ...@@ -531,7 +531,7 @@ class StudentProctoredExamAttemptCollection(AuthenticatedAPIView):
except ProctoredBaseException, ex: except ProctoredBaseException, ex:
return Response( return Response(
status=status.HTTP_400_BAD_REQUEST, status=status.HTTP_400_BAD_REQUEST,
data={"detail": str(ex)} data={"detail": unicode(ex)}
) )
......
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