From 386c26b1b23a64d6d8a2f3302047f25d3019e6ef Mon Sep 17 00:00:00 2001 From: jazyz Date: Fri, 23 Jun 2023 15:35:30 -0400 Subject: [PATCH] Fixed Organization Pagination Rank Reset On Each Page Closes #2224 --- judge/views/organization.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/judge/views/organization.py b/judge/views/organization.py index 3fd29da984..90524666c9 100644 --- a/judge/views/organization.py +++ b/judge/views/organization.py @@ -139,7 +139,11 @@ def get_queryset(self): def get_context_data(self, **kwargs): context = super(OrganizationUsers, self).get_context_data(**kwargs) context['title'] = _('%s Members') % self.object.name - context['users'] = ranker(context['users']) + context['users'] = ranker( + context['users'], + key=attrgetter('performance_points', 'problem_count'), + rank=self.paginate_by * (context['page_obj'].number - 1), + ) context['partial'] = True context['is_admin'] = self.can_edit_organization() context['kick_url'] = reverse('organization_user_kick', args=[self.object.id, self.object.slug])