Remove use of non-relational fields in select_related queries

These changes should not change the actual queries at all, and those
will throw errors in Django 1.11.
This commit is contained in:
bmedx
2017-11-14 10:10:08 -05:00
parent 1e6c72c5b6
commit 09e5156543
5 changed files with 6 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ class BulkCourseTags(object):
and the secondary key is the course tag's key
"""
course_tags = defaultdict(dict)
for tag in UserCourseTag.objects.filter(user__in=users, course_id=course_id).select_related('user__id'):
for tag in UserCourseTag.objects.filter(user__in=users, course_id=course_id).select_related('user'):
course_tags[tag.user.id][tag.key] = tag.value
get_cache(cls.CACHE_NAMESPACE)[cls._cache_key(course_id)] = course_tags