File tree 3 files changed +3
-3
lines changed
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>
4
4
Jerel Unruh <mail@unruhdesigns.com>
5
5
Matt Layman <http://www.mattlayman.com>
6
6
Oliver 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):
41
41
offset = 10
42
42
limit = 5
43
43
count = len (self .queryset )
44
- last_offset = count - limit
44
+ last_offset = ( count // limit ) * limit
45
45
next_offset = 15
46
46
prev_offset = 5
47
47
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ def get_last_link(self):
64
64
url = self .request .build_absolute_uri ()
65
65
url = replace_query_param (url , self .limit_query_param , self .limit )
66
66
67
- offset = self .count - self .limit
67
+ offset = ( self .count // self . limit ) * self .limit
68
68
69
69
if offset <= 0 :
70
70
return remove_query_param (url , self .offset_query_param )
You can’t perform that action at this time.
0 commit comments