Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-gray-tangent committed Jul 12, 2024
1 parent 767f17c commit bae6a6a
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions app/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.db.models import Count
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render
from django.utils.http import urlencode
from django.utils.translation import gettext as _

from general.filters import DocumentFileFilter
Expand Down Expand Up @@ -255,21 +256,13 @@ def search(request):
return render(request, template_name=template, context=context)


def pagination_url(
request,
):
def pagination_url(request):
url_params = {
"search": request.GET.get("search", ""),
"document_type": request.GET.get("document_type", ""),
"institution": request.GET.get("institution", ""),
"subjects": request.GET.get("subjects", ""),
"languages": request.GET.get("languages", ""),
"document_type": request.GET.getlist("document_type", []),
"institution": request.GET.getlist("institution", []),
"subjects": request.GET.getlist("subjects", []),
"languages": request.GET.getlist("languages", []),
}

return "?search={search}&document_type={document_type}&institution={institution}&subjects={subjects}&languages={languages}".format(
search=url_params["search"],
document_type=url_params["document_type"],
institution=url_params["institution"],
subjects=url_params["subjects"],
languages=url_params["languages"],
)
return "?" + urlencode(url_params, doseq=True)

0 comments on commit bae6a6a

Please sign in to comment.