fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set perks on form save.
[wolnelektury.git]
/
apps
/
funding
/
forms.py
diff --git
a/apps/funding/forms.py
b/apps/funding/forms.py
index
f566e8e
..
165c64d
100644
(file)
--- a/
apps/funding/forms.py
+++ b/
apps/funding/forms.py
@@
-31,10
+31,12
@@
class FundingForm(forms.Form):
return self.cleaned_data
def save(self):
return self.cleaned_data
def save(self):
-
return
Funding.objects.create(
+
funding =
Funding.objects.create(
offer=self.offer,
name=self.cleaned_data['name'],
email=self.cleaned_data['email'],
amount=self.cleaned_data['amount'],
)
offer=self.offer,
name=self.cleaned_data['name'],
email=self.cleaned_data['email'],
amount=self.cleaned_data['amount'],
)
+ funding.perks = funding.offer.get_perks(funding.amount)
+ return funding