|
@@ -308,8 +308,9 @@ def create(request, content_type_app_name, content_type_model_name, parent_page_
|
|
|
|
|
|
|
|
|
|
def edit(request, page_id):
|
|
def edit(request, page_id):
|
|
- latest_revision = get_object_or_404(Page, id=page_id).get_latest_revision()
|
|
|
|
- page = get_object_or_404(Page, id=page_id).get_latest_revision_as_page()
|
|
|
|
|
|
+ real_page_record = get_object_or_404(Page, id=page_id)
|
|
|
|
+ latest_revision = real_page_record.get_latest_revision()
|
|
|
|
+ page = real_page_record.get_latest_revision_as_page()
|
|
parent = page.get_parent()
|
|
parent = page.get_parent()
|
|
|
|
|
|
content_type = ContentType.objects.get_for_model(page)
|
|
content_type = ContentType.objects.get_for_model(page)
|
|
@@ -515,9 +516,9 @@ def edit(request, page_id):
|
|
|
|
|
|
messages.warning(request, _("This page is currently awaiting moderation"), buttons=buttons)
|
|
messages.warning(request, _("This page is currently awaiting moderation"), buttons=buttons)
|
|
|
|
|
|
- # Page status needs to present the version of the page containing the correct live URL
|
|
|
|
- if page.has_unpublished_changes:
|
|
|
|
- page_for_status = latest_revision.page.specific
|
|
|
|
|
|
+ if page.live and page.has_unpublished_changes:
|
|
|
|
+ # Page status needs to present the version of the page containing the correct live URL
|
|
|
|
+ page_for_status = real_page_record.specific
|
|
else:
|
|
else:
|
|
page_for_status = page
|
|
page_for_status = page
|
|
|
|
|