equal
deleted
inserted
replaced
130 |
130 |
131 class PaymentForm(forms.ModelForm): |
131 class PaymentForm(forms.ModelForm): |
132 """SciPyCon Payment form |
132 """SciPyCon Payment form |
133 """ |
133 """ |
134 |
134 |
|
135 paid = forms.BooleanField( |
|
136 required=False, label="Amount paid", |
|
137 help_text="Check this box if you have already paid the fees.") |
|
138 |
135 def save(self, user, scope): |
139 def save(self, user, scope): |
136 try: |
140 try: |
137 payment = Payment.objects.get(user=user, scope=scope) |
141 payment = Payment.objects.get(user=user, scope=scope) |
138 except ObjectDoesNotExist: |
142 except ObjectDoesNotExist: |
139 payment = Payment(user=user, scope=scope) |
143 payment = Payment(user=user, scope=scope) |
140 |
144 |
141 paid = self.cleaned_data['paid'] |
145 paid = self.cleaned_data['paid'] |
142 type = self.cleaned_data['type'] |
146 type = self.cleaned_data['type'] |
143 details = self.cleaned_data['details'] |
147 details = self.cleaned_data['details'] |
144 |
148 |
145 payment.paid = paid |
|
146 payment.type = type |
149 payment.type = type |
147 payment.details = details |
150 payment.details = details |
148 |
151 |
149 payment.save() |
152 payment.save() |
150 |
153 |