From b4f2afa03a14c2f2f589ff87d4441c6da25d370a Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Tue, 26 Nov 2013 16:51:05 +0100 Subject: [PATCH] No longer strip the beginning of a paste! --- dpaste/forms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dpaste/forms.py b/dpaste/forms.py index e163b64..4dc07ff 100644 --- a/dpaste/forms.py +++ b/dpaste/forms.py @@ -65,7 +65,10 @@ class SnippetForm(forms.ModelForm): def clean_content(self): - return self.cleaned_data.get('content', '').strip() + content = self.cleaned_data.get('content', '') + if content.strip() == '': + raise forms.ValidationError(_('Plesae fill out this field.')) + return content def clean(self): # The `title` field is a hidden honeypot field. If its filled,