nanterre: correction aux URLs de pagination (fixes #19592)

This commit is contained in:
Benjamin Dauvergne 2017-10-20 21:17:52 +02:00
parent de183d29e0
commit d562b0e3f0
1 changed files with 3 additions and 2 deletions

View File

@ -32,6 +32,7 @@ from django.db.transaction import non_atomic_requests, atomic
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse
from django.utils.timezone import now
from django.utils.http import urlencode
from rest_framework.views import APIView
from rest_framework.response import Response
@ -831,7 +832,7 @@ class JournalView(IndividuViewMixin, APIView):
more_url = request.build_absolute_uri(
reverse('rsu-api-journal', kwargs={'identifier': individu.id}))
cookie = str(max_id)
more_url += '?limit=%d&cookie=%s' % (limit, cookie)
more_url += '?' + urlencode({'limit': limit, 'cookie': cookie})
content['cookie'] = cookie
content['more'] = more_url
return Response(content)
@ -1881,7 +1882,7 @@ class DoublonsView(DoublonMixin, APIView):
max_id = qs[limit - 1].id
more_url = request.build_absolute_uri(reverse('rsu-api-doublons'))
cookie = '%s_%s' % (since, max_id)
more_url += '?limit=%d&cookie=%s' % (limit, cookie)
more_url += '?' + urlencode({'limit': limit, 'cookie': cookie})
content['more'] = more_url
content['cookie'] = cookie
return Response(content)