paperwork: Use shop lead flag for certification emails
This commit is contained in:
parent
d3eb890e89
commit
1dd4825a99
@ -8,8 +8,6 @@ from django.template import loader
|
||||
from markdownify import markdownify
|
||||
import mdformat
|
||||
|
||||
from membershipworks.models import Member
|
||||
|
||||
|
||||
def make_multipart_email(subject, html_body, to):
|
||||
plain_body = mdformat.text(markdownify(html_body), extensions={"tables"})
|
||||
@ -28,9 +26,9 @@ def make_multipart_email(subject, html_body, to):
|
||||
|
||||
def make_department_email(department, certifications):
|
||||
template = loader.get_template("paperwork/email/department_certifications.dj.html")
|
||||
shop_leads = Member.objects.filter(
|
||||
flags__type="label", flags__name="Shop Lead: " + department
|
||||
).values_list("first_name", "account_name", "email", named=True)
|
||||
shop_leads = department.shop_lead_flag.members.values_list(
|
||||
"first_name", "account_name", "email", named=True
|
||||
)
|
||||
|
||||
html_body = template.render(
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user