Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit cb33ba6

Browse files
authored
Remove redundant call to publish_page() (#1355)
* Remove rendundant call to publish_page() As the page is already published, this was causing Django-CMS to fail with a `NodeAlreadySaved` exception from treebeard. The only thing it looked to be doing that `cms.api.create_page()` was not was assigning a user to the page, and this can already be done with `create_page()` using the `created_by` argument. Fixex #1349. * Re-enable test disabled in #1348 (706617e)
1 parent c3d729e commit cb33ba6

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

conference/management/commands/create_initial_data_for_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def new_page(rev_id, title, **kwargs):
127127
"generic_content_page_with_sidebar.html"
128128
),
129129
published=True,
130+
created_by=admin.user,
130131
publication_date=timezone.now(),
131132
in_navigation=True,
132133
**kwargs,
@@ -137,7 +138,6 @@ def new_page(rev_id, title, **kwargs):
137138
language="en",
138139
body=f"This is the page content for {title}",
139140
)
140-
publish_page(page, user=admin.user, language="en")
141141
print("Created page: ", page.reverse_id, title, page.template)
142142
return page
143143

tests/test_provisioning_script.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from pytest import mark
55

66

7-
# XXX This will have to be investigated further, but not now...
8-
@mark.skip(reason='Getting a weird error from the script')
97
@mark.django_db
108
def test_basic_create_initial_data_for_dev_run():
119

0 commit comments

Comments
 (0)