Commit d9b2a5bc by benjaoming

Merge pull request #166 from BenMarchant/patch-2

Visitor cannot use admin as a slug (just in case !)
parents 3d573b03 0449a292
......@@ -250,6 +250,8 @@ class CreateForm(forms.Form, SpamProtectionMixin):
slug = self.cleaned_data['slug']
if slug.startswith("_"):
raise forms.ValidationError(_(u'A slug may not begin with an underscore.'))
if slug == 'admin':
raise forms.ValidationError(_(u'Sorry, you cannot use admin as a slug !'))
if settings.URL_CASE_SENSITIVE:
already_existing_slug = models.URLPath.objects.filter(slug=slug, parent=self.urlpath_parent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment