0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

Prevent update_locale to be used for pages that aren't at the root of the tree

This commit is contained in:
Tidiane Dia 2022-01-07 12:03:31 +00:00 committed by Matt Westcott
parent 0e4dc26376
commit d05095b4c3

View File

@ -82,6 +82,10 @@ class CreatePageAliasAction:
raise CreatePageAliasIntegrityError(
"You cannot copy a tree branch recursively into itself"
)
if not parent.is_root() and self.update_locale is not None:
raise CreatePageAliasIntegrityError(
"You cannot manually set locale of a page that's not at the root of the tree."
)
if (
self.user