oliver-zehentleitner / maity

hub: one verified/held-address predicate and one address-holder lookup in notifications.address

Sign in to report

tsk-358e999n5gm1 Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication / debt.

What is wrong

  • "Verified or disabled" (an address in use) by hand: hub/src/maity_hub/notifications/address.py:154, 213, 235, 355, hub/src/maity_hub/invitation_mail.py:55.
  • "Verified" beside verified_row (address.py:99-106): account_deletion.py:281-289 (_verified_address re-implements it), notifications/mailer.py:118, mail/outbox.py:403, routes/email_sign_in.py:129-130, routes/password_reset.py:120-121, routes/mail_settings.py:63.
  • The holder-of-a-normalized-address query three times in address.py: 347-352, 401-405, 432-437 (has_verified_address).
  • address.py:356-361 keeps a fallback for rows older than migration 20261115000000; alpha, no such rows.

Proposal: row predicates is_verified(row) and holds_address(row) in notifications/address.py; _verified_address calls verified_row; claim_verified reuses has_verified_address; drop the pre-migration fallback.

Effort / risk: S. Low risk.