From 6a8546801c1e3d85c088dfe608bcf25a519ffa14 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Wed, 11 Sep 2013 10:18:00 -0400 Subject: [PATCH] Response.json is now a callable --- .../open_ended_grading_classes/grading_service_module.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py index 3a107d51c1..6248c63091 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py @@ -42,7 +42,7 @@ class GradingService(object): response.raise_for_status() - return response.json + return response.json() def post(self, url, data, allow_redirects=False): """ @@ -88,9 +88,10 @@ class GradingService(object): Returns the result of operation(). Does not catch exceptions. """ response = operation() - if (response.json - and response.json.get('success') is False - and response.json.get('error') == 'login_required'): + resp_json = response.json() + 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. r = self._login() if r and not r.get('success'):