minor display fix
[wolnelektury.git] / apps / funding / forms.py
index f566e8e..3bd7f1d 100644 (file)
@@ -1,5 +1,5 @@
 from django import forms
-from django.utils.translation import ugettext_lazy as _, ugettext as __
+from django.utils.translation import ugettext_lazy as _, ugettext as __, get_language
 from .models import Funding
 from .widgets import PerksAmountWidget
 
@@ -31,10 +31,13 @@ class FundingForm(forms.Form):
         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'],
+            language_code = get_language(),
         )
+        funding.perks = funding.offer.get_perks(funding.amount)
+        return funding