mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-12-19 00:09:21 +11:00
Moved inside the function so its re-evaluated for every testcase.
This commit is contained in:
parent
983d8d1dc8
commit
fae95e1e2a
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue