Skip to content

Commit 1bbef1e

Browse files
jared mauchjared mauch
authored andcommitted
Fix list name display in password upgrade notifications
- Store both listname and mlist object to preserve original listname - Use email address listname part for display instead of real_name - This ensures correct list identification when multiple lists share the same real_name - Add clarifying comment about OwnerNotification sending to -owner address
1 parent 43e9a77 commit 1bbef1e

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

bin/update

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,8 @@ def check_and_notify_password_upgrades(dry_run=False):
722722
needs_upgrade = True
723723

724724
if needs_upgrade:
725-
lists_needing_upgrade.append(mlist)
725+
# Store both the listname and mlist so we can display the correct name
726+
lists_needing_upgrade.append((listname, mlist))
726727

727728
# Check global passwords
728729
global_passwords_old = []
@@ -745,14 +746,16 @@ def check_and_notify_password_upgrades(dry_run=False):
745746
if dry_run:
746747
print(C_('DRY-RUN: Would send password upgrade notifications to %(count)d list(s).') % {
747748
'count': len(lists_needing_upgrade)})
748-
for mlist in lists_needing_upgrade:
749-
# Use real_name for display, fallback to internal_name if real_name is not set
750-
display_name = mlist.real_name or mlist.internal_name()
749+
for listname, mlist in lists_needing_upgrade:
750+
# Use the list email address as the display name to ensure uniqueness
751+
listaddr = mlist.GetListEmail()
752+
# Extract listname part from email for display (everything before @)
753+
display_name = listaddr.split('@')[0] if '@' in listaddr else listname
751754
print(C_(' - Would notify owners of %(listname)s (%(listaddr)s)') % {
752755
'listname': display_name,
753-
'listaddr': mlist.GetListEmail()})
756+
'listaddr': listaddr})
754757
else:
755-
for mlist in lists_needing_upgrade:
758+
for listname, mlist in lists_needing_upgrade:
756759
send_password_upgrade_notification(mlist)
757760

758761
# Note about global passwords
@@ -823,7 +826,9 @@ Thank you for your attention to this important security upgrade.
823826
'listname': listname
824827
}
825828

826-
# Send to all list owners
829+
# Send to list administrators via the -owner address
830+
# OwnerNotification sends to mlist.owner addresses and sets To: header
831+
# to the -owner address (e.g., listname-owner@domain.com)
827832
msg = Message.OwnerNotification(
828833
mlist, subject, text, tomoderators=0)
829834
msg.send(mlist)

0 commit comments

Comments
 (0)