mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-24 10:58:52 +01:00
replacing lines from another botched merge
This commit is contained in:
parent
2dd991af53
commit
97e815903e
@ -25,16 +25,14 @@ def index(request, parent_page_id=None):
|
||||
pages = parent_page.get_children().prefetch_related('content_type')
|
||||
|
||||
# Get page ordering
|
||||
if 'ordering' in request.GET:
|
||||
ordering = request.GET['ordering']
|
||||
|
||||
if ordering in ['title', '-title', 'content_type', '-content_type', 'live', '-live']:
|
||||
pages = pages.order_by(ordering)
|
||||
else:
|
||||
ordering = request.GET.get('ordering', 'title')
|
||||
if ordering not in ['title', '-title', 'content_type', '-content_type', 'live', '-live', 'ord']:
|
||||
ordering = 'title'
|
||||
|
||||
# Pagination
|
||||
if ordering != 'ord':
|
||||
pages = pages.order_by(ordering)
|
||||
|
||||
p = request.GET.get('p', 1)
|
||||
paginator = Paginator(pages, 50)
|
||||
try:
|
||||
@ -181,6 +179,7 @@ def create(request, content_type_app_name, content_type_model_name, parent_page_
|
||||
'parent_page': parent_page,
|
||||
'edit_handler': edit_handler,
|
||||
'display_modes': page.get_page_modes(),
|
||||
'form': form, # Used in unit tests
|
||||
})
|
||||
|
||||
|
||||
@ -266,6 +265,7 @@ def edit(request, page_id):
|
||||
'edit_handler': edit_handler,
|
||||
'errors_debug': errors_debug,
|
||||
'display_modes': page.get_page_modes(),
|
||||
'form': form, # Used in unit tests
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user