Skip to content
Snippets Groups Projects
Verified Commit 8cf9dfb9 authored by ynerant's avatar ynerant
Browse files

Reduce complexity of the validation of a user, add verbosity in comments


Signed-off-by: ynerant's avatarYohann D'ANELLO <ynerant@crans.org>
parent c3ab61bd
No related branches found
No related tags found
2 merge requests!172WEI, diverses améliorations,!163More linting
Pipeline #8941 failed with stages
in 10 minutes and 34 seconds
...@@ -282,20 +282,19 @@ class FutureUserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, FormMixin, ...@@ -282,20 +282,19 @@ class FutureUserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, FormMixin,
fee = 0 fee = 0
bde = Club.objects.get(name="BDE") bde = Club.objects.get(name="BDE")
bde_fee = bde.membership_fee_paid if user.profile.paid else bde.membership_fee_unpaid bde_fee = bde.membership_fee_paid if user.profile.paid else bde.membership_fee_unpaid
if join_bde: # This is mandatory.
fee += bde_fee fee += bde_fee if join_bde else 0
kfet = Club.objects.get(name="Kfet") kfet = Club.objects.get(name="Kfet")
kfet_fee = kfet.membership_fee_paid if user.profile.paid else kfet.membership_fee_unpaid kfet_fee = kfet.membership_fee_paid if user.profile.paid else kfet.membership_fee_unpaid
if join_kfet: # Add extra fee for the full membership
fee += kfet_fee fee += kfet_fee if join_kfet else 0
if soge: # If the bank pays, then we don't credit now. Treasurers will validate the transaction
# If the bank pays, then we don't credit now. Treasurers will validate the transaction # and credit the note later.
# and credit the note later. credit_type = None if soge else credit_type
credit_type = None
if credit_type is None: # If the user does not select any payment method, then no credit will be performed.
credit_amount = 0 credit_amount = 0 if credit_type is None else credit_amount
if fee > credit_amount and not soge: if fee > credit_amount and not soge:
# Check if the user credits enough money # Check if the user credits enough money
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment