mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-16 03:03:14 +00:00
add_subpage view now sorts content types by their verbose names.
This commit is contained in:
parent
8e3c9e9721
commit
9f97e32960
1 changed files with 3 additions and 1 deletions
|
|
@ -73,7 +73,9 @@ def add_subpage(request, parent_page_id):
|
|||
if not parent_page.permissions_for_user(request.user).can_add_subpage():
|
||||
raise PermissionDenied
|
||||
|
||||
page_types = sorted(parent_page.allowed_subpage_types(), key=lambda pagetype: pagetype.name.lower())
|
||||
page_types = sorted(parent_page.allowed_subpage_types(),
|
||||
key=lambda pagetype: pagetype.model_class().get_verbose_name().lower()
|
||||
)
|
||||
|
||||
if len(page_types) == 1:
|
||||
# Only one page type is available - redirect straight to the create form rather than
|
||||
|
|
|
|||
Loading…
Reference in a new issue