fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cop notes.
[wolnelektury.git]
/
src
/
club
/
forms.py
diff --git
a/src/club/forms.py
b/src/club/forms.py
index
5ca0827
..
2664fa3
100644
(file)
--- a/
src/club/forms.py
+++ b/
src/club/forms.py
@@
-20,6
+20,10
@@
class ScheduleForm(forms.ModelForm, NewsletterForm):
'monthly': forms.HiddenInput,
}
'monthly': forms.HiddenInput,
}
+ def __init__(self, referer=None, **kwargs):
+ self.referer = referer
+ super().__init__(**kwargs)
+
def clean_amount(self):
value = self.cleaned_data['amount']
club = models.Club.objects.first()
def clean_amount(self):
value = self.cleaned_data['amount']
club = models.Club.objects.first()
@@
-33,6
+37,7
@@
class ScheduleForm(forms.ModelForm, NewsletterForm):
def save(self, *args, **kwargs):
NewsletterForm.save(self, *args, **kwargs)
def save(self, *args, **kwargs):
NewsletterForm.save(self, *args, **kwargs)
+ self.instance.source = self.referer or ''
return super().save(*args, **kwargs)
return super().save(*args, **kwargs)