Add distinct to contest display
This commit is contained in:
parent
37f8675f06
commit
0e8b7f51ee
1 changed files with 2 additions and 2 deletions
|
@ -81,8 +81,8 @@ class PostList(ListView):
|
|||
q |= Q(is_organization_private=True, organizations__in=user.organizations.all())
|
||||
q |= Q(is_private=True, private_contestants=user)
|
||||
visible_contests = visible_contests.filter(q)
|
||||
context['current_contests'] = visible_contests.filter(start_time__lte=now, end_time__gt=now)
|
||||
context['future_contests'] = visible_contests.filter(start_time__gt=now)
|
||||
context['current_contests'] = visible_contests.filter(start_time__lte=now, end_time__gt=now).distinct()
|
||||
context['future_contests'] = visible_contests.filter(start_time__gt=now).distinct()
|
||||
|
||||
if self.request.user.is_authenticated:
|
||||
profile = self.request.profile
|
||||
|
|
Loading…
Reference in a new issue