From 198e5252fb8efb8485a833e89a28fb28dde48708 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Fri, 22 Mar 2013 19:41:00 +0100 Subject: [PATCH] Set a max_length for all snippets. Nobody needs more than 256k of space. --- dpaste/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dpaste/forms.py b/dpaste/forms.py index 04f9704..4556cca 100644 --- a/dpaste/forms.py +++ b/dpaste/forms.py @@ -17,11 +17,13 @@ EXPIRE_CHOICES = ( EXPIRE_DEFAULT = 3600 * 24 * 30 +MAX_CONTENT_LENGTH = 250*1024*1024 class SnippetForm(forms.ModelForm): content = forms.CharField( label=_('Content'), widget=forms.Textarea(attrs={'placeholder': _('Awesome code goes here...')}), + max_length=MAX_CONTENT_LENGTH, ) lexer = forms.ChoiceField(