Skip to content

Commit

Permalink
(no-ticket) Django 1.11: UnorderedObjectListWarning: Pagination...
Browse files Browse the repository at this point in the history
Change-Id: Ieb22962ccf2f8c45968045025bd2fdb296e82fa1
  • Loading branch information
CezaryChodun committed Mar 31, 2020
1 parent cf205cf commit e89bfe2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion oioioi/portals/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def portals_main_page_view(request, view_type='public'):
form = None
views = None
return render(request, 'portals/portals_main_page.html',
{'portals': portals_to_display,
{'portals': portals_to_display.order_by('id'),
'page_title': page_title,
'form': form,
'views': views,
Expand Down
2 changes: 2 additions & 0 deletions oioioi/problems/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ def problemset_get_problems(request):
+ 'statistics_' + field)
else:
raise Http404
else:
problems = problems.order_by('ascii_name')

problems = problems.select_related('problemsite')
return problems
Expand Down
2 changes: 1 addition & 1 deletion oioioi/usergroups/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class GroupsListView(ListView):
template_name = 'usergroups/teacher_usergroups_list.html'

def get_queryset(self):
queryset = UserGroup.objects.filter(owners__in=[self.request.user])
queryset = UserGroup.objects.filter(owners__in=[self.request.user]).order_by('id')

return queryset

Expand Down

0 comments on commit e89bfe2

Please sign in to comment.