From fae95e1e2a0922038670555e4dd9cff375bdc42f Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Wed, 18 Dec 2013 12:54:13 +0100 Subject: [PATCH] Moved inside the function so its re-evaluated for every testcase. --- dpaste/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpaste/forms.py b/dpaste/forms.py index 53af4fc..1849cec 100644 --- a/dpaste/forms.py +++ b/dpaste/forms.py @@ -14,8 +14,6 @@ EXPIRE_CHOICES = getattr(settings, 'DPASTE_EXPIRE_CHOICES', ( )) EXPIRE_DEFAULT = getattr(settings, 'DPASTE_EXPIRE_DEFAULT', EXPIRE_CHOICES[2][0]) MAX_CONTENT_LENGTH = getattr(settings, 'DPASTE_MAX_CONTENT_LENGTH', 250*1024*1024) -MAX_SNIPPETS_PER_USER = getattr(settings, 'DPASTE_MAX_SNIPPETS_PER_USER', 15) - class SnippetForm(forms.ModelForm): content = forms.CharField( @@ -78,6 +76,8 @@ class SnippetForm(forms.ModelForm): return self.cleaned_data def save(self, parent=None, *args, **kwargs): + MAX_SNIPPETS_PER_USER = getattr(settings, 'DPASTE_MAX_SNIPPETS_PER_USER', 15) + # Set parent snippet if parent: self.instance.parent = parent