kopia lustrzana https://github.com/wagtail/wagtail
Fix bug introduced by a1c9224
The a1c9224
commit allowed page editing only when their slug had been
changed!
pull/190/head
rodzic
c1ac89ceb7
commit
b442bab7a7
|
@ -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
|
# Stick an extra validator into the form to make sure that the slug is not already in use
|
||||||
def clean_slug(slug):
|
def clean_slug(slug):
|
||||||
# Make sure the slug isn't already in use
|
# 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"))
|
raise ValidationError(_("This slug is already in use"))
|
||||||
return slug
|
return slug
|
||||||
form.fields['slug'].clean = clean_slug
|
form.fields['slug'].clean = clean_slug
|
||||||
|
|
Ładowanie…
Reference in New Issue