Skip to content

Commit

Permalink
(no-ticket) Use distinct in visible_contests
Browse files Browse the repository at this point in the history
We noticed using debug toolbar, that the results from the query
come from the database duplicated.

I did not investigate exactly, where it came from, but this
should not hurt.

Change-Id: I21282dd491c124162e03bc36df871f171043ae6d
  • Loading branch information
accek committed Dec 17, 2019
1 parent 71b906d commit 7d02863
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oioioi/contests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def visible_contests(request):
controller = controller_class(None)
visible_query |= (Q(controller_name=controller_name) & controller
.registration_controller().visible_contests_query(request))
return set(Contest.objects.filter(visible_query))
return set(Contest.objects.filter(visible_query).distinct())


@request_cached
Expand Down

0 comments on commit 7d02863

Please sign in to comment.