[WEI] Update validation buttons for 1A

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-09-07 15:11:15 +02:00
parent da1e15c5e6
commit b27341009e
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 4 additions and 1 deletions

View File

@ -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.")