From a94389fd7d6a20a7ab55b96b366c2c569b6693cd Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Mon, 12 Mar 2018 13:53:10 +0100 Subject: [PATCH] Fixed Auto-Strip content in charfield in Form. --- dpaste/forms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dpaste/forms.py b/dpaste/forms.py index b6c1173..c64c520 100644 --- a/dpaste/forms.py +++ b/dpaste/forms.py @@ -39,25 +39,26 @@ class SnippetForm(forms.ModelForm): label=_('Content'), widget=forms.Textarea(attrs={'placeholder': _('Awesome code goes here...')}), max_length=MAX_CONTENT_LENGTH, + strip=False ) lexer = forms.ChoiceField( label=_('Lexer'), initial=LEXER_DEFAULT, - choices=LEXER_LIST, + choices=LEXER_LIST ) expires = forms.ChoiceField( label=_('Expires'), choices=EXPIRE_CHOICES, - initial=EXPIRE_DEFAULT, + initial=EXPIRE_DEFAULT ) # Honeypot field title = forms.CharField( label=_('Title'), required=False, - widget=forms.TextInput(attrs={'autocomplete': 'off'}), + widget=forms.TextInput(attrs={'autocomplete': 'off'}) ) class Meta: @@ -81,7 +82,6 @@ class SnippetForm(forms.ModelForm): self.fields['lexer'].initial = request.GET['l'] def clean_content(self): - import ipdb, os; os.system("stty sane"); ipdb.set_trace() content = self.cleaned_data.get('content', '') if content.strip() == '': raise forms.ValidationError(_('This field is required.'))