paperwork: Remove suffixes from names in shopleads mailing list

Mailman3 doesn't have display names per list anymore, so this is
somewhat confusing
This commit is contained in:
Adam Goldsmith 2024-02-07 13:40:04 -05:00
parent 83da93b712
commit 43f992e2c3
2 changed files with 3 additions and 6 deletions

View File

@ -273,7 +273,7 @@ class Member(BaseModel):
if hasattr(user, "ldap_user"): if hasattr(user, "ldap_user"):
return cls.objects.get(uid=user.ldap_user.attrs["employeeNumber"][0]) 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: if use_volunteer and self.volunteer_email:
email = self.volunteer_email email = self.volunteer_email
elif self.email: elif self.email:
@ -285,7 +285,7 @@ class Member(BaseModel):
return email return email
return django.core.mail.message.sanitize_address( return django.core.mail.message.sanitize_address(
(self.account_name + name_ext, email), settings.DEFAULT_CHARSET (self.account_name, email), settings.DEFAULT_CHARSET
) )

View File

@ -92,10 +92,7 @@ class DepartmentViewSet(viewsets.ModelViewSet):
# Add members to the Shop Leads mailing list, but don't configure it # Add members to the Shop Leads mailing list, but don't configure it
lists["ShopLeads"] = { lists["ShopLeads"] = {
"members": { "members": {
shoplead.sanitized_mailbox( shoplead.sanitized_mailbox(use_volunteer=True)
f" - {'/'.join(department.name for department in departments)}",
use_volunteer=True,
)
for shoplead, departments in shopleads.items() for shoplead, departments in shopleads.items()
}, },
} }