Commit 46fddc6d by Jason Bau

Merge pull request #1052 from edx/jbau/staff-needs-to-grade-use-get

use .get when checking combined notifications to handle missing keys
parents 01a42925 aa080190
......@@ -154,8 +154,9 @@ def combined_notifications(course, user):
controller_response = controller_qs.check_combined_notifications(course.id, student_id, user_is_staff,
last_time_viewed)
notifications = json.loads(controller_response)
if notifications['success']:
if notifications['staff_needs_to_grade'] or notifications['student_needs_to_peer_grade']:
if notifications.get('success'):
if (notifications.get('staff_needs_to_grade') or
notifications.get('student_needs_to_peer_grade')):
pending_grading = True
except:
#Non catastrophic error, so no real action
......
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