Skip to content

Commit

Permalink
Simplify UserPaginator.page_range a bit
Browse files Browse the repository at this point in the history
Since the minimal value of UserPaginator._current_page is
set in the constructor, we don't need max(..., 1).
  • Loading branch information
berkerpeksag committed Aug 13, 2017
1 parent e8b8b6d commit f45912a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion users/paginators.py
Expand Up @@ -16,6 +16,6 @@ def page(self, number):
@property
def page_range(self):
return list(range(
max(self._current_page, 1),
self._current_page,
min(self._current_page + self._page_range_size + 1, self.num_pages + 1)
))

0 comments on commit f45912a

Please sign in to comment.