Skip to content
Snippets Groups Projects
Commit 508332f1 authored by frekk's avatar frekk
Browse files

added more validation to renewal

parent 25f33b8a
Branches
Tags
No related merge requests found
...@@ -71,7 +71,11 @@ class MembershipApprovalForm(MyModelForm): ...@@ -71,7 +71,11 @@ class MembershipApprovalForm(MyModelForm):
data['date_approved'] = now data['date_approved'] = now
if (data['payment_confirm'] == True): if (data['payment_confirm'] == True):
if (data['payment_method'] == ''):
self.add_error('payment_method', 'Please select a payment method')
data['date_paid'] = now data['date_paid'] = now
else:
data['date_paid'] = None
# make sure "no payment" is recorded for Life Members. # make sure "no payment" is recorded for Life Members.
# XXX this might not actually be the case, since some life members may want to also be financial members (ie. for constitutional voting rights) # XXX this might not actually be the case, since some life members may want to also be financial members (ie. for constitutional voting rights)
...@@ -124,7 +128,6 @@ class MembershipApprovalAdminView(MyUpdateView): ...@@ -124,7 +128,6 @@ class MembershipApprovalAdminView(MyUpdateView):
called when the approval form is submitted and valid data (according to the form's field types and defined validators) is given called when the approval form is submitted and valid data (according to the form's field types and defined validators) is given
""" """
def form_valid(self, form): def form_valid(self, form):
breakpoint()
ms = form.save() ms = form.save()
self.admin.message_user(self.request, 'Approve success') self.admin.message_user(self.request, 'Approve success')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment