Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Greg Aker <greg@gregaker.net>
Jerel Unruh <mail@unruhdesigns.com>
Matt Layman <http://www.mattlayman.com>
Oliver Sauder <os@esite.ch>

Yaniv Peer <yanivpeer@gmail.com>
2 changes: 1 addition & 1 deletion example/tests/unit/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_valid_offset_limit(self):
offset = 10
limit = 5
count = len(self.queryset)
last_offset = count - limit
last_offset = (count // limit) * limit
next_offset = 15
prev_offset = 5

Expand Down
2 changes: 1 addition & 1 deletion rest_framework_json_api/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_last_link(self):
url = self.request.build_absolute_uri()
url = replace_query_param(url, self.limit_query_param, self.limit)

offset = self.count - self.limit
offset = (self.count // self.limit) * self.limit

if offset <= 0:
return remove_query_param(url, self.offset_query_param)
Expand Down