From 23a5bd05e71cfbf07d6d09736eb860190817adf2 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Sat, 18 Apr 2020 01:36:24 +0200 Subject: [PATCH] Add email state statistics --- logs/views.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/logs/views.py b/logs/views.py index 7c509134..5d67f0eb 100644 --- a/logs/views.py +++ b/logs/views.py @@ -284,6 +284,24 @@ def stats_general(request): _all_whitelisted.exclude(adherent__isnull=True).count(), _all_whitelisted.exclude(club__isnull=True).count(), ], + "email_state_verified_users": [ + _("Users with a verified email"), + User.objects.filter(email_state=User.EMAIL_STATE_VERIFIED).count(), + Adherent.objects.filter(email_state=User.EMAIL_STATE_VERIFIED).count(), + Club.objects.filter(email_state=User.EMAIL_STATE_VERIFIED).count(), + ], + "email_state_unverified_users": [ + _("Users with an unverified email"), + User.objects.filter(email_state=User.EMAIL_STATE_UNVERIFIED).count(), + Adherent.objects.filter(email_state=User.EMAIL_STATE_UNVERIFIED).count(), + Club.objects.filter(email_state=User.EMAIL_STATE_UNVERIFIED).count(), + ], + "email_state_pending_users": [ + _("Users pending email confirmation"), + User.objects.filter(email_state=User.EMAIL_STATE_PENDING).count(), + Adherent.objects.filter(email_state=User.EMAIL_STATE_PENDING).count(), + Club.objects.filter(email_state=User.EMAIL_STATE_PENDING).count(), + ], "actives_interfaces": [ _("Active interfaces (with access to the network)"), _all_active_interfaces_count.count(),