fix(auth): keep the admin notice unconditional on the register path

Round 4 showed the `inv is not None` gate added in b5a1002 removed a signal that
matters: for an address the admin had already approved, that email is their only
notice that someone has now created an account on it — the invite is not pending
so nothing lands in the Access-requests queue either. Suppressing it left the
registrant at "awaiting admin approval" with the admin unaware they existed. The
duplicate it avoided (Request access, then sign up) is mild noise by comparison.

The production change is now one db.commit(), which is all the reported bug ever
needed. Release notes corrected again: a previously-denied address was also
unaffected, the pending-request case never lost its queue entry (only the
account behind it), and the test inventory was missing a guard.
This commit is contained in:
2026-09-01 21:48:40 +02:00
parent b64c3f514d
commit f6e1d1e69f
3 changed files with 12 additions and 12 deletions
+4 -3
View File
@@ -183,8 +183,9 @@ def test_registration_of_a_pre_approved_email_persists_the_account_without_smtp(
# so their Google sign-in keeps working and an anonymous sign-up cannot revoke access.
assert invite.status == "approved"
assert invite.decided_by == "admin@example.com"
# …and no "new access request" notice, because there is no fresh decision to make.
assert notified == []
# The admin is still told: for an already-approved address this notice is their only signal
# that an account now exists on it, and it is inactive until they act.
assert notified == ["roland@example.com"]
def test_registration_with_an_already_pending_request_persists_the_account(
@@ -204,7 +205,7 @@ def test_registration_with_an_already_pending_request_persists_the_account(
assert user is not None, "registration was rolled back — the account is gone"
assert user.is_active is False
assert invite.status == "pending"
assert notified == [] # the admin already has this request; don't send a second copy
assert notified == ["pia@example.com"]
def test_an_admin_can_activate_a_pre_approved_registrant(db, make_user, monkeypatch):