Permalink
Browse files

Merge pull request #1485 from yakky/feature/slug_check

Fix for #1484
  • Loading branch information...
2 parents ae6beb6 + 4a2e116 commit af529e6fa1577dc623d08d10b82228304b7c2f0c @digi604 digi604 committed Oct 19, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 cms/admin/forms.py
View
@@ -113,7 +113,7 @@ def clean(self):
#AdminFormsTests.test_clean_overwrite_url validates the form with when no page instance available
#Looks like just a theoretical corner case
title = page.get_title_obj(lang)
- if title:
+ if title and slug:
oldslug = title.slug
title.slug = slug
title.save()
@@ -122,8 +122,9 @@ def clean(self):
except ValidationError,e:
title.slug = oldslug
title.save()
- del cleaned_data['published']
- self._errors['published'] = ErrorList(e.messages)
+ if 'slug' in cleaned_data:
+ del cleaned_data['slug']
+ self._errors['slug'] = ErrorList(e.messages)
return cleaned_data
def clean_slug(self):

0 comments on commit af529e6

Please sign in to comment.