From 43f992e2c32e9e0d0660cb6a102f996b27d83127 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 7 Feb 2024 13:40:04 -0500 Subject: [PATCH] paperwork: Remove suffixes from names in shopleads mailing list Mailman3 doesn't have display names per list anymore, so this is somewhat confusing --- membershipworks/models.py | 4 ++-- paperwork/api.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index 7c18cb4..5df7c6b 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -273,7 +273,7 @@ class Member(BaseModel): if hasattr(user, "ldap_user"): return cls.objects.get(uid=user.ldap_user.attrs["employeeNumber"][0]) - def sanitized_mailbox(self, name_ext: str = "", use_volunteer=False) -> str: + def sanitized_mailbox(self, use_volunteer=False) -> str: if use_volunteer and self.volunteer_email: email = self.volunteer_email elif self.email: @@ -285,7 +285,7 @@ class Member(BaseModel): return email return django.core.mail.message.sanitize_address( - (self.account_name + name_ext, email), settings.DEFAULT_CHARSET + (self.account_name, email), settings.DEFAULT_CHARSET ) diff --git a/paperwork/api.py b/paperwork/api.py index 5a1bebe..1c6c478 100644 --- a/paperwork/api.py +++ b/paperwork/api.py @@ -92,10 +92,7 @@ class DepartmentViewSet(viewsets.ModelViewSet): # Add members to the Shop Leads mailing list, but don't configure it lists["ShopLeads"] = { "members": { - shoplead.sanitized_mailbox( - f" - {'/'.join(department.name for department in departments)}", - use_volunteer=True, - ) + shoplead.sanitized_mailbox(use_volunteer=True) for shoplead, departments in shopleads.items() }, }