fix slug field validation
This commit is contained in:
parent
4f849f88ee
commit
ab576cd095
1 changed files with 1 additions and 1 deletions
|
@ -125,7 +125,7 @@ class EditorFormBase(ModelForm):
|
||||||
LocationSlug = self.request.changeset.wrap_model('LocationSlug')
|
LocationSlug = self.request.changeset.wrap_model('LocationSlug')
|
||||||
qs = LocationSlug.objects.filter(slug__in=self.add_redirect_slugs)
|
qs = LocationSlug.objects.filter(slug__in=self.add_redirect_slugs)
|
||||||
|
|
||||||
if self.cleaned_data['slug'] in self.add_redirect_slugs:
|
if 'slug' in self.cleaned_data and self.cleaned_data['slug'] in self.add_redirect_slugs:
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
_('Can not add redirecting slug “%s”: it\'s the slug of this object.') % self.cleaned_data['slug']
|
_('Can not add redirecting slug “%s”: it\'s the slug of this object.') % self.cleaned_data['slug']
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue