From 334005ef2feb6d1eec857582f57bb7efc3e7166f Mon Sep 17 00:00:00 2001 From: Awais Jibran Date: Fri, 24 Jul 2015 19:17:46 +0500 Subject: [PATCH] Grading doesn't work for XML courses TNL-2879 --- lms/djangoapps/courseware/grades.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/courseware/grades.py b/lms/djangoapps/courseware/grades.py index 0ce78a4e51..86120f62c4 100644 --- a/lms/djangoapps/courseware/grades.py +++ b/lms/djangoapps/courseware/grades.py @@ -60,7 +60,12 @@ class MaxScoresCache(object): max scores -- any time a content change occurs, we change our cache keys. """ - return cls(u"{}.{}".format(course.id, course.subtree_edited_on.isoformat())) + if course.subtree_edited_on is None: + # check for subtree_edited_on because old XML courses doesn't have this attribute + cache_key = u"{}".format(course.id) + else: + cache_key = u"{}.{}".format(course.id, course.subtree_edited_on.isoformat()) + return cls(cache_key) def fetch_from_remote(self, locations): """