From b27341009e159279ec86b1bab35a7391ed77a0f0 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 7 Sep 2021 15:11:15 +0200 Subject: [PATCH] [WEI] Update validation buttons for 1A Signed-off-by: Yohann D'ANELLO --- apps/wei/tables.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/wei/tables.py b/apps/wei/tables.py index b2e55508..0f862cc9 100644 --- a/apps/wei/tables.py +++ b/apps/wei/tables.py @@ -99,9 +99,12 @@ class WEIRegistrationTable(tables.Table): url = reverse_lazy('wei:validate_registration', args=(record.pk,)) text = _('Validate') - if record.fee > record.user.note.balance: + if record.fee > record.user.note.balance and not record.soge_credit: btn_class = 'btn-secondary' tooltip = _("The user does not have enough money.") + elif record.first_year and 'selected_bus_pk' not in record.information: + btn_class = 'btn-info' + tooltip = _("The user is in first year, and the repartition algorithm didn't run.") else: btn_class = 'btn-success' tooltip = _("The user has enough money, you can validate the registration.")