mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-16 04:51:01 +00:00
Set treebeard attributes in preview on create view. Fixes #320
This commit is contained in:
parent
7f72bdd917
commit
db6bb920fb
1 changed files with 4 additions and 0 deletions
|
|
@ -364,6 +364,10 @@ def preview_on_create(request, content_type_app_name, content_type_model_name, p
|
|||
parent_page = get_object_or_404(Page, id=parent_page_id).specific
|
||||
page.set_url_path(parent_page)
|
||||
|
||||
# Set treebeard attributes
|
||||
page.depth = parent_page.depth + 1
|
||||
page.path = Page._get_children_path_interval(parent_page.path)[1]
|
||||
|
||||
# This view will generally be invoked as an AJAX request; as such, in the case of
|
||||
# an error Django will return a plaintext response. This isn't what we want, since
|
||||
# we will be writing the response back to an HTML page regardless of success or
|
||||
|
|
|
|||
Loading…
Reference in a new issue