From 285b963cd9d3ede4f106d09f7e994325c1d77698 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 10 Dec 2019 11:38:57 +0000 Subject: [PATCH] people: Show pending registrations Signed-off-by: Michael Tremer --- src/backend/accounts.py | 6 ++++++ src/templates/people/stats.html | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/backend/accounts.py b/src/backend/accounts.py index d4241c10..42d16249 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -334,6 +334,12 @@ class Accounts(Object): "(&(objectClass=inetOrgPerson)(|(sipAuthenticationUser=%s)(telephoneNumber=%s)(homePhone=%s)(mobile=%s)))" \ % (number, number, number, number)) + @property + def pending_registrations(self): + res = self.db.get("SELECT COUNT(*) AS c FROM account_activations") + + return res.c or 0 + async def check_spam(self, uid, email, address): sfs = StopForumSpam(self.backend, uid, email, address) diff --git a/src/templates/people/stats.html b/src/templates/people/stats.html index 93c026a5..3a1d2b6b 100644 --- a/src/templates/people/stats.html +++ b/src/templates/people/stats.html @@ -27,6 +27,14 @@

{{ backend.accounts.count_created_after(t) }}

{{ _("Created This Month") }}
+ + {% set pending_registrations = backend.accounts.pending_registrations %} + {% if pending_registrations %} +
+ +

{{ pending_registrations }}

+
{{ _("Pending Registrations") }}
+ {% end %} -- 2.47.3