From acb3fb4a91b83887516601aa2504f56faea21b7f Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 7 Oct 2020 17:42:46 +0200 Subject: [PATCH 1/2] Highlight future users that declared that they opened a bank account --- apps/registration/tables.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/registration/tables.py b/apps/registration/tables.py index 274369fe..9b124ffa 100644 --- a/apps/registration/tables.py +++ b/apps/registration/tables.py @@ -4,6 +4,8 @@ import django_tables2 as tables from django.contrib.auth.models import User +from treasury.models import SogeCredit + class FutureUserTable(tables.Table): """ @@ -21,6 +23,7 @@ class FutureUserTable(tables.Table): fields = ('last_name', 'first_name', 'username', 'email', ) model = User row_attrs = { - 'class': 'table-row', + 'class': lambda record: 'table-row' + + (' bg-warning' if SogeCredit.objects.filter(user=record).exists() else ''), 'data-href': lambda record: record.pk } From 3eced33082822f87de028d965c2e342465ea8be0 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 7 Oct 2020 17:43:28 +0200 Subject: [PATCH 2/2] Well, everyone doesn't want a secondary bank account --- apps/registration/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/registration/views.py b/apps/registration/views.py index 1ec069a4..3c2ea0a7 100644 --- a/apps/registration/views.py +++ b/apps/registration/views.py @@ -235,7 +235,7 @@ class FutureUserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, FormMixin, fee += 8000 ctx["total_fee"] = "{:.02f}".format(fee / 100, ) - ctx["declare_soge_account"] = True + ctx["declare_soge_account"] = SogeCredit.objects.filter(user=user).exists() return ctx