Fix CMS sorting bug
This commit is contained in:
parent
18c6e0ac72
commit
db6c2c4f8b
|
|
@ -135,7 +135,7 @@ def get_objectives_groups_in_specific_order(module):
|
||||||
# Create a specific order for the objective groups
|
# Create a specific order for the objective groups
|
||||||
# https://stackoverflow.com/questions/5966462/sort-queryset-by-values-in-list
|
# https://stackoverflow.com/questions/5966462/sort-queryset-by-values-in-list
|
||||||
# https://docs.djangoproject.com/en/5.0/ref/models/conditional-expressions/
|
# https://docs.djangoproject.com/en/5.0/ref/models/conditional-expressions/
|
||||||
order_of_objective_groups = ["Sprache & Kommunikation", "Gesellschaft", "Übergeordnete Lernziele"]
|
order_of_objective_groups = ["language_communication", "society", "interdisciplinary"]
|
||||||
_whens = []
|
_whens = []
|
||||||
for sort_index, value in enumerate(order_of_objective_groups):
|
for sort_index, value in enumerate(order_of_objective_groups):
|
||||||
_whens.append(
|
_whens.append(
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from django.views.decorators.csrf import ensure_csrf_cookie
|
||||||
from graphene_django.views import GraphQLView
|
from graphene_django.views import GraphQLView
|
||||||
from graphql import get_operation_ast, parse
|
from graphql import get_operation_ast, parse
|
||||||
from sentry_sdk.api import start_transaction
|
from sentry_sdk.api import start_transaction
|
||||||
from wagtail.admin.views.pages.listing import IndexView
|
from wagtail.admin.views.pages import listing
|
||||||
|
|
||||||
logger = get_logger(__name__)
|
logger = get_logger(__name__)
|
||||||
|
|
||||||
|
|
@ -67,4 +67,4 @@ def override_wagtailadmin_explore_default_ordering(request, parent_page_id):
|
||||||
# Display reordering handles by default for children of all Page types.
|
# Display reordering handles by default for children of all Page types.
|
||||||
return HttpResponseRedirect(request.path_info + "?ordering=ord")
|
return HttpResponseRedirect(request.path_info + "?ordering=ord")
|
||||||
|
|
||||||
return IndexView.as_view(request=request, parent_page_id=parent_page_id)
|
return listing.IndexView.as_view()(request, parent_page_id)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue