paperwork: Fix regression in Shopleads
mailing list membership
This commit is contained in:
parent
8b1722d1f0
commit
3e003bddb7
@ -49,17 +49,12 @@ class DepartmentViewSet(viewsets.ModelViewSet):
|
||||
"shop_lead_flag__members",
|
||||
)
|
||||
lists: dict[str, MailingList] = {}
|
||||
shopleads: dict[Member, list[Department]] = {}
|
||||
for department in departments.filter(has_mailing_list=True):
|
||||
if department.shop_lead_flag is not None:
|
||||
moderator_emails = {
|
||||
member.volunteer_email if member.volunteer_email else member.email
|
||||
for member in department.shop_lead_flag.members.all()
|
||||
}
|
||||
for member in department.shop_lead_flag.members.all():
|
||||
if member not in shopleads:
|
||||
shopleads[member] = []
|
||||
shopleads[member].append(department)
|
||||
else:
|
||||
moderator_emails = set()
|
||||
|
||||
@ -98,6 +93,13 @@ class DepartmentViewSet(viewsets.ModelViewSet):
|
||||
if department.parent_id is None:
|
||||
recurse_children(department)
|
||||
|
||||
shopleads: dict[Member, list[Department]] = {}
|
||||
for department in departments.filter(shop_lead_flag__isnull=False):
|
||||
for member in department.shop_lead_flag.members.all():
|
||||
if member not in shopleads:
|
||||
shopleads[member] = []
|
||||
shopleads[member].append(department)
|
||||
|
||||
# Add members to the Shop Leads mailing list, but don't configure it
|
||||
lists["ShopLeads"] = {
|
||||
"members": {
|
||||
|
Loading…
Reference in New Issue
Block a user