From 1dd4825a996c9c47d4b8207156b1ee44c14eb683 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 31 Jan 2023 18:58:22 -0500 Subject: [PATCH] paperwork: Use shop lead flag for certification emails --- paperwork/certification_emails.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/paperwork/certification_emails.py b/paperwork/certification_emails.py index c12fdb1..ee24d8f 100644 --- a/paperwork/certification_emails.py +++ b/paperwork/certification_emails.py @@ -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( {