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
d4b80025
Commit
d4b80025
authored
Feb 24, 2014
by
Dave St.Germain
Committed by
Sarina Canelake
Nov 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes MAT-4
parent
843225ca
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 @
d4b80025
...
@@ -18,7 +18,7 @@ try:
...
@@ -18,7 +18,7 @@ try:
except
ImportError
:
except
ImportError
:
def
force_unicode
(
x
):
def
force_unicode
(
x
):
return
(
x
)
return
(
x
)
from
django.utils.html
import
escape
,
conditional_escape
from
django.utils.html
import
escape
,
conditional_escape
,
strip_tags
from
django.core.urlresolvers
import
resolve
,
Resolver404
from
django.core.urlresolvers
import
resolve
,
Resolver404
from
itertools
import
chain
from
itertools
import
chain
...
@@ -153,6 +153,10 @@ class EditForm(forms.Form, SpamProtectionMixin):
...
@@ -153,6 +153,10 @@ class EditForm(forms.Form, SpamProtectionMixin):
super
(
EditForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
EditForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
def
clean_title
(
self
):
title
=
strip_tags
(
self
.
cleaned_data
[
'title'
])
return
title
def
clean
(
self
):
def
clean
(
self
):
cd
=
self
.
cleaned_data
cd
=
self
.
cleaned_data
if
self
.
no_clean
or
self
.
preview
:
if
self
.
no_clean
or
self
.
preview
:
...
@@ -255,6 +259,10 @@ class CreateForm(forms.Form, SpamProtectionMixin):
...
@@ -255,6 +259,10 @@ class CreateForm(forms.Form, SpamProtectionMixin):
summary
=
forms
.
CharField
(
label
=
_
(
'Summary'
),
help_text
=
_
(
"Write a brief message for the article's history log."
),
summary
=
forms
.
CharField
(
label
=
_
(
'Summary'
),
help_text
=
_
(
"Write a brief message for the article's history log."
),
required
=
False
)
required
=
False
)
def
clean_title
(
self
):
title
=
strip_tags
(
self
.
cleaned_data
[
'title'
])
return
title
def
clean_slug
(
self
):
def
clean_slug
(
self
):
slug
=
self
.
cleaned_data
[
'slug'
]
slug
=
self
.
cleaned_data
[
'slug'
]
if
slug
.
startswith
(
"_"
):
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