diff --git a/paperwork/admin.py b/paperwork/admin.py index be40909..86aee5c 100644 --- a/paperwork/admin.py +++ b/paperwork/admin.py @@ -90,13 +90,13 @@ class CertificationAdmin(admin.ModelAdmin): def send_notifications(self, request, queryset): try: emails = list(all_certification_emails(queryset)) - print(emails) with mail.get_connection() as conn: conn.send_messages(emails) for cert in queryset: - cert.update(shop_lead_notified=Now()) + cert.shop_lead_notified = Now() + cert.save() self.message_user( request, diff --git a/paperwork/certification_emails.py b/paperwork/certification_emails.py index e82c306..0e6f270 100644 --- a/paperwork/certification_emails.py +++ b/paperwork/certification_emails.py @@ -88,7 +88,11 @@ def admin_email(ordered_queryset): f"{len(ordered_queryset)} new CMS Certifications issued", html_body, # TODO: Admin emails should probably be from a group, not all staff - to=[get_user_model().filter(is_staff=True).values("email", flat=True)], + to=( + get_user_model() + .objects.filter(is_staff=True) + .values_list("email", flat=True) + ), )