Commit 8b8c1dbe by Vik Paruchuri

Fix query error

parent 3531bce7
......@@ -66,9 +66,14 @@ def combined_notifications(course, user):
course_id = course.id
min_time_to_query = user.last_login
last_module_seen = StudentModule.objects.filter(student=user, course_id = course_id, modified__gt=min_time_to_query).values('modified').order_by('-modified')[0]
last_module_seen = StudentModule.objects.filter(student=user, course_id = course_id, modified__gt=min_time_to_query).values('modified').order_by('-modified')
last_module_seen_count = last_module_seen.count()
if last_module_seen_count>0:
last_time_viewed = last_module_seen[0]['modified']
else:
last_time_viewed = user.last_login
last_time_viewed = last_module_seen['modified']
pending_grading= False
img_path= ""
......
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