Commit 33a69864 by Tom Christie

Ensure pagination URLs are fully qualified

parent bc6f2a17
......@@ -15,7 +15,7 @@ class NextPageField(serializers.Field):
return None
page = value.next_page_number()
request = self.context.get('request')
url = request and request.get_full_path() or ''
url = request and request.build_absolute_uri() or ''
return replace_query_param(url, self.page_field, page)
......@@ -30,7 +30,7 @@ class PreviousPageField(serializers.Field):
return None
page = value.previous_page_number()
request = self.context.get('request')
url = request and request.get_full_path() or ''
url = request and request.build_absolute_uri() or ''
return replace_query_param(url, self.page_field, page)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment