File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ Greg Aker <greg@gregaker.net>
44Jerel Unruh <mail@unruhdesigns.com>
55Matt Layman <http://www.mattlayman.com>
66Oliver Sauder <os@esite.ch>
7-
7+ Yaniv Peer <yanivpeer@gmail.com>
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def test_valid_offset_limit(self):
4141 offset = 10
4242 limit = 5
4343 count = len (self .queryset )
44- last_offset = count - limit
44+ last_offset = ( count // limit ) * limit
4545 next_offset = 15
4646 prev_offset = 5
4747
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ def get_last_link(self):
6464 url = self .request .build_absolute_uri ()
6565 url = replace_query_param (url , self .limit_query_param , self .limit )
6666
67- offset = self .count - self .limit
67+ offset = ( self .count // self . limit ) * self .limit
6868
6969 if offset <= 0 :
7070 return remove_query_param (url , self .offset_query_param )
You can’t perform that action at this time.
0 commit comments