Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
d9b2a5bc
Commit
d9b2a5bc
authored
Jun 17, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #166 from BenMarchant/patch-2
Visitor cannot use admin as a slug (just in case !)
parents
3d573b03
0449a292
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
wiki/forms.py
+2
-0
No files found.
wiki/forms.py
View file @
d9b2a5bc
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment