Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
5411207e
Commit
5411207e
authored
2 years ago
by
Štěpán Farka
Committed by
jan.bednarik
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] fixed ordering pages only for ajax calls
parent
12a183eb
No related branches found
No related tags found
2 merge requests
!564
Release
,
!558
Enhancements 11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tuning/wagtail_hooks.py
+6
-1
6 additions, 1 deletion
tuning/wagtail_hooks.py
with
6 additions
and
1 deletion
tuning/wagtail_hooks.py
+
6
−
1
View file @
5411207e
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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment