Skip to content

Commit

Permalink
Removes leading|trailing pipes and spaces while saving.
Browse files Browse the repository at this point in the history
This could lead to dramatic problems…
  • Loading branch information
BertrandBordage committed Jun 30, 2013
1 parent 96078ae commit 5520dca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions terms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@


class TermForm(ModelForm):
def clean_name(self):
data = self.cleaned_data
return data['name'].strip(' |')

def clean(self):
definition = self.cleaned_data.get('definition')
url = self.cleaned_data.get('url')
Expand Down

0 comments on commit 5520dca

Please sign in to comment.