Members page: show a live total member count
Count every membership account (free and paid together) on each page load and show it under the headline; no per-tier numbers. Hidden when there are no members. Also correct the reference tiers.eom.json and service-groups.eom.json to the real LDAP DNs (ou=Memberships; ou=<Service>,ou=Services), which now match the ansible-role-www defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,15 @@ class RegistrationTests(TestCase):
|
||||
self.assertEqual(response.headers["Cache-Control"], "no-store")
|
||||
self.assertContains(self.client.get("/members/register/"), "Send verification email")
|
||||
|
||||
def test_home_shows_live_total_member_count(self):
|
||||
self.assertNotContains(self.client.get("/members/"), "member-count")
|
||||
Account.objects.create(uid="alice", email="alice@example.org")
|
||||
self.assertContains(self.client.get("/members/"), "<strong>1</strong> member and counting", html=False)
|
||||
Account.objects.create(uid="bob", email="bob@example.org", membership_level=3)
|
||||
response = self.client.get("/members/")
|
||||
# One total across free and paid levels; no per-tier numbers.
|
||||
self.assertContains(response, "<strong>2</strong> members and counting", html=False)
|
||||
|
||||
def start_signup(self):
|
||||
self.client.post("/members/register/", {"uid": "alice", "email": "ALICE@example.org"})
|
||||
match = re.search(r"/verify/([^/]+)/", str(mail.outbox[-1].body))
|
||||
|
||||
Reference in New Issue
Block a user