Compare commits

..

3 Commits

View File

@ -45,8 +45,8 @@ def config_list(
"anonymous_list": True, "anonymous_list": True,
"archive_policy": "private", "archive_policy": "private",
"member_roster_visibility": "moderators", "member_roster_visibility": "moderators",
"subscribe_policy": "confirm_then_moderate", "subscription_policy": "confirm_then_moderate",
"unsubscribe_policy": "confirm", "unsubscription_policy": "confirm",
"default_member_action": "hold", "default_member_action": "hold",
"default_nonmember_action": "discard", "default_nonmember_action": "discard",
"advertised": False, "advertised": False,
@ -68,7 +68,7 @@ def diff_roster(
expected_members_dict = dict( expected_members_dict = dict(
list(reversed(email.utils.parseaddr(member))) for member in expected_members list(reversed(email.utils.parseaddr(member))) for member in expected_members
) )
existing_members_dict = {member.address: member for member in existing_members} existing_members_dict = {str(member.address): member for member in existing_members}
members_to_add = { members_to_add = {
k: expected_members_dict[k] k: expected_members_dict[k]
for k in set(expected_members_dict) - set(existing_members_dict) for k in set(expected_members_dict) - set(existing_members_dict)
@ -112,7 +112,7 @@ def sync_moderators(
for address, display_name in members_to_add.items(): for address, display_name in members_to_add.items():
print(f"Adding '{display_name} <{address}>' as moderator to list {list}") print(f"Adding '{display_name} <{address}>' as moderator to list {list}")
if not dry_run: if not dry_run:
list.subscribe(address, display_name) list.add_moderator(address, display_name)
for member in members_to_remove: for member in members_to_remove:
print(f"Removing {member} as moderator from list {list}") print(f"Removing {member} as moderator from list {list}")