Permalink
Browse files

Fixed url overwrite bug

  • Loading branch information...
1 parent 2cc7d7e commit 88ff422a51da233b86babc9c4f62f2b2108d714d Jonas Obrist committed Aug 4, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 cms/admin/forms.py
View
@@ -176,7 +176,8 @@ def clean_overwrite_url(self):
if url:
if not any_path_re.match(url):
raise forms.ValidationError(_('Invalid URL, use /my/url format.'))
- if get_page_from_path(url.strip('/')):
+ page = get_page_from_path(url.strip('/'))
+ if page and page.pk != self.instance.pk:
raise forms.ValidationError(_('Page with redirect url %r already exist') % url)
return url

0 comments on commit 88ff422

Please sign in to comment.