upgrade done
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user