mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-19 04:31:11 +00:00
Fix bug introduced by a1c9224
The a1c9224 commit allowed page editing only when their slug had been changed!
This commit is contained in:
parent
c1ac89ceb7
commit
b442bab7a7
1 changed files with 1 additions and 1 deletions
|
|
@ -234,7 +234,7 @@ def edit(request, page_id):
|
|||
# Stick an extra validator into the form to make sure that the slug is not already in use
|
||||
def clean_slug(slug):
|
||||
# Make sure the slug isn't already in use
|
||||
if parent.get_children().filter(slug=slug).count() > 0:
|
||||
if parent.get_children().filter(slug=slug).exclude(id=page_id).count() > 0:
|
||||
raise ValidationError(_("This slug is already in use"))
|
||||
return slug
|
||||
form.fields['slug'].clean = clean_slug
|
||||
|
|
|
|||
Loading…
Reference in a new issue