add_subpage view now sorts content types by their verbose names.

This commit is contained in:
Robert Rollins 2014-12-13 17:56:02 -08:00 committed by Matt Westcott
parent 8e3c9e9721
commit 9f97e32960

View file

@ -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