Private
Public Access
1
0

upgrade done

This commit is contained in:
Sander Roosendaal
2018-12-19 22:53:07 +01:00
parent a0a03a90df
commit 3ff114a307
7 changed files with 324 additions and 8 deletions

View File

@@ -720,12 +720,26 @@ class PlanSelectForm(forms.Form):
def __init__(self, *args, **kwargs):
paymentprocessor = kwargs.pop('paymentprocessor',None)
rower = kwargs.pop('rower',None)
super(PlanSelectForm, self).__init__(*args, **kwargs)
self.fields['plan'].empty_label = None
if paymentprocessor:
self.fields['plan'].queryset = PaidPlan.objects.filter(
paymentprocessor=paymentprocessor
).exclude(shortname="basic").order_by("price","clubsize","shortname")
).exclude(
shortname="basic"
).order_by(
"price","clubsize","shortname"
)
if rower:
amount = rower.paidplan.price
self.fields['plan'].queryset = PaidPlan.objects.filter(
paymentprocessor=rower.paymentprocessor
).exclude(
price__lte=amount
).order_by(
"price","clubsize","shortname"
)
class CourseSelectForm(forms.Form):
course = forms.ModelChoiceField(queryset=GeoCourse.objects.all())