Skip to content

Commit

Permalink
ignore page[] url query args, fixes #71
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaxxl committed Jul 30, 2020
1 parent 7b09e63 commit 197ff65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion safrs/jsonapi_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ def paginate(object_query, SAFRSObject=None):

def get_link(count, limit):
result = SAFRSObject._s_url if SAFRSObject else ""
ignore_args = "page[offset]","page[limit]"
result += "?" + "&".join(
["{}={}".format(k, v) for k, v in request.args.items()] + ["page[offset]={}&page[limit]={}".format(count, limit)]
["{}={}".format(k, v) for k, v in request.args.items() if not k in ignore_args] + ["page[offset]={}&page[limit]={}".format(count, limit)]
)
return result

Expand Down

0 comments on commit 197ff65

Please sign in to comment.