Rather than deleting CourseOverviews to update their version numbers, just reload them from the modulestore

This commit is contained in:
Calen Pennington
2020-01-15 13:30:41 -05:00
parent 6dbc0e77d2
commit 2abfc665da

View File

@@ -321,9 +321,8 @@ class CourseOverview(TimeStampedModel):
try:
course_overview = cls.objects.select_related('image_set').get(id=course_id)
if course_overview.version < cls.VERSION:
# Throw away old versions of CourseOverview, as they might contain stale data.
course_overview.delete()
course_overview = None
# Reload the overview from the modulestore to update the version
course_overview = cls.load_from_module_store(course_id)
except cls.DoesNotExist:
course_overview = None