Use the correct response when using login.

This commit is contained in:
Diana Huang
2014-04-08 11:08:34 -04:00
parent 3f0a40513e
commit ef3a2b8545

View File

@@ -119,14 +119,15 @@ class GradingService(object):
if (resp_json
and resp_json.get('success') is False
and resp_json.get('error') == 'login_required'):
# apparrently we aren't logged in. Try to fix that.
# apparently we aren't logged in. Try to fix that.
r = self._login()
if r and not r.get('success'):
log.warning("Couldn't log into staff_grading backend. Response: %s",
log.warning("Couldn't log into ORA backend. Response: %s",
r)
# try again
# try again
response = operation()
response.raise_for_status()
resp_json = response.json()
return resp_json