Commit cd0b2b31 by Dave St.Germain

Merge pull request #4 from edx/dcs/mat-4

Fixes MAT-4
parents 00424a12 7aa9d0c2
...@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _ ...@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.forms.util import flatatt from django.forms.util import flatatt
from django.utils.encoding import force_unicode 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 from itertools import chain
...@@ -85,6 +85,10 @@ class EditForm(forms.Form): ...@@ -85,6 +85,10 @@ class EditForm(forms.Form):
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:
...@@ -206,6 +210,10 @@ class CreateForm(forms.Form): ...@@ -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."), summary = forms.CharField(label=_(u'Summary'), help_text=_(u"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("_"):
......
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