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
edx
django-wiki
Commits
cd0b2b31
Commit
cd0b2b31
authored
Feb 28, 2014
by
Dave St.Germain
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from edx/dcs/mat-4
Fixes MAT-4
parents
00424a12
7aa9d0c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
wiki/forms.py
+9
-1
No files found.
wiki/forms.py
View file @
cd0b2b31
...
...
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _
from
django.utils.safestring
import
mark_safe
from
django.forms.util
import
flatatt
from
django.utils.encoding
import
force_unicode
from
django.utils.html
import
escape
,
conditional_escape
from
django.utils.html
import
escape
,
conditional_escape
,
strip_tags
from
itertools
import
chain
...
...
@@ -85,6 +85,10 @@ class EditForm(forms.Form):
super
(
EditForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
def
clean_title
(
self
):
title
=
strip_tags
(
self
.
cleaned_data
[
'title'
])
return
title
def
clean
(
self
):
cd
=
self
.
cleaned_data
if
self
.
no_clean
or
self
.
preview
:
...
...
@@ -206,6 +210,10 @@ class CreateForm(forms.Form):
summary
=
forms
.
CharField
(
label
=
_
(
u'Summary'
),
help_text
=
_
(
u"Write a brief message for the article's history log."
),
required
=
False
)
def
clean_title
(
self
):
title
=
strip_tags
(
self
.
cleaned_data
[
'title'
])
return
title
def
clean_slug
(
self
):
slug
=
self
.
cleaned_data
[
'slug'
]
if
slug
.
startswith
(
"_"
):
...
...
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