From: Michael Tremer Date: Tue, 10 Dec 2019 11:38:57 +0000 (+0000) Subject: people: Show pending registrations X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=285b963cd9d3ede4f106d09f7e994325c1d77698;p=ipfire.org.git people: Show pending registrations Signed-off-by: Michael Tremer --- 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 %}