Skip to content
Snippets Groups Projects
Commit 5411207e authored by Štěpán Farka's avatar Štěpán Farka Committed by jan.bednarik
Browse files

[FIX] fixed ordering pages only for ajax calls

parent 12a183eb
No related branches found
No related tags found
2 merge requests!564Release,!558Enhancements 11
import re
from django.conf import settings
from django.contrib.postgres.lookups import Unaccent
from django.db.models.functions import Lower
......@@ -27,7 +29,10 @@ def add_another_welcome_panel(request, panels):
@hooks.register("construct_explorer_page_queryset")
def show_my_profile_only(parent_page, pages, request):
return pages.order_by(Unaccent(Lower("title")))
requested_html = re.search(r"^text/html", request.META.get("HTTP_ACCEPT"))
if not requested_html:
return pages.order_by(Unaccent(Lower("title")))
return pages
@hooks.register("insert_global_admin_css")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment