Skip to content

Commit

Permalink
Fixed Organization Pagination Rank Reset On Each Page
Browse files Browse the repository at this point in the history
Closes DMOJ#2224
  • Loading branch information
jazyz committed Jun 23, 2023
1 parent ddc624b commit 386c26b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion judge/views/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 386c26b

Please sign in to comment.