From b442bab7a7ea9f66a65fd313139403207cb682d0 Mon Sep 17 00:00:00 2001 From: Serafeim Papastefanos Date: Thu, 3 Apr 2014 21:42:44 +0300 Subject: [PATCH] Fix bug introduced by a1c9224 The a1c9224 commit allowed page editing only when their slug had been changed! --- wagtail/wagtailadmin/views/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/wagtailadmin/views/pages.py b/wagtail/wagtailadmin/views/pages.py index 3c3d5a33d6..3fb9057151 100644 --- a/wagtail/wagtailadmin/views/pages.py +++ b/wagtail/wagtailadmin/views/pages.py @@ -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