Skip to content

Commit

Permalink
0.4 LPO performance update - Fixed dupe learners
Browse files Browse the repository at this point in the history
Looks like all we needed to do was add `.distinct()` to the queryset
results
  • Loading branch information
johnbaldwin committed Dec 11, 2020
1 parent 82a9f42 commit 65174d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions figures/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def get_enrolled_users(self, site, course_keys):
qs = figures.sites.get_users_for_site(site).filter(
courseenrollment__course_id__in=course_keys
).select_related('profile').prefetch_related('courseenrollment_set')
return qs
return qs.distinct()

def get_queryset(self):
"""
Expand Down Expand Up @@ -527,7 +527,7 @@ def get_enrolled_users(self, site, course_keys):
qs = figures.sites.get_users_for_site(site).filter(
enrollmentdata__course_id__in=course_keys
).select_related('profile').prefetch_related('enrollmentdata_set')
return qs
return qs.distinct()

def get_queryset(self):
"""
Expand Down

0 comments on commit 65174d3

Please sign in to comment.