Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix for pagination ‘last’ link to give the real last page #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
mblayman merged 3 commits into django-json-api:develop from yanivp:bugfix/fix_pagination_last_link
May 28, 2017
Merged
Changes from 1 commit
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
Next Next commit
Fix for pagination ‘last’ link to give the real last page
  • Loading branch information
Yaniv Peer committed May 24, 2017
commit e50b3cab06f505c629df6309299dd6a7452883df
2 changes: 1 addition & 1 deletion rest_framework_json_api/pagination.py
View file Open in desktop
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

AltStyle によって変換されたページ (->オリジナル) /