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",
|
"shop_lead_flag__members",
|
||||||
)
|
)
|
||||||
lists: dict[str, MailingList] = {}
|
lists: dict[str, MailingList] = {}
|
||||||
shopleads: dict[Member, list[Department]] = {}
|
|
||||||
for department in departments.filter(has_mailing_list=True):
|
for department in departments.filter(has_mailing_list=True):
|
||||||
if department.shop_lead_flag is not None:
|
if department.shop_lead_flag is not None:
|
||||||
moderator_emails = {
|
moderator_emails = {
|
||||||
member.volunteer_email if member.volunteer_email else member.email
|
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()
|
||||||
}
|
}
|
||||||
for member in department.shop_lead_flag.members.all():
|
|
||||||
if member not in shopleads:
|
|
||||||
shopleads[member] = []
|
|
||||||
shopleads[member].append(department)
|
|
||||||
else:
|
else:
|
||||||
moderator_emails = set()
|
moderator_emails = set()
|
||||||
|
|
||||||
@ -98,6 +93,13 @@ class DepartmentViewSet(viewsets.ModelViewSet):
|
|||||||
if department.parent_id is None:
|
if department.parent_id is None:
|
||||||
recurse_children(department)
|
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
|
# Add members to the Shop Leads mailing list, but don't configure it
|
||||||
lists["ShopLeads"] = {
|
lists["ShopLeads"] = {
|
||||||
"members": {
|
"members": {
|
||||||
|
Loading…
Reference in New Issue
Block a user