Commit 85b5190c by Victor Shnayder

fix login hack. Uses new return-error-msg-if-not-logged-in behavior

parent c9d399d3
...@@ -89,7 +89,9 @@ class StaffGradingService(object): ...@@ -89,7 +89,9 @@ class StaffGradingService(object):
Returns the result of operation(). Does not catch exceptions. Returns the result of operation(). Does not catch exceptions.
""" """
response = operation() response = operation()
if (response.status_code == 302): if (response.json
and response.json.get('success') == False
and response.json.get('error') == 'login_required'):
# apparrently we aren't logged in. Try to fix that. # apparrently we aren't logged in. Try to fix that.
r = self._login() r = self._login()
if r and not r.get('success'): if r and not r.get('success'):
......
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