From 6fad8d534e7a45faf7c1d5bb20edd12b5fcc2133 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 15 Mar 2022 14:29:37 -0400 Subject: [PATCH] [paperwork] Add explicit `backend` to User.with_perms call --- paperwork/certification_emails.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/paperwork/certification_emails.py b/paperwork/certification_emails.py index c4a10ba..c12fdb1 100644 --- a/paperwork/certification_emails.py +++ b/paperwork/certification_emails.py @@ -90,7 +90,11 @@ def admin_email(ordered_queryset): to=( get_user_model() .objects.with_perm( - "paperwork.receive_certification_emails", include_superusers=False + "paperwork.receive_certification_emails", + include_superusers=False, + # TODO: backend should not be hardcoded + # TODO: LDAPBackend does not support with_perm() directly + backend="django.contrib.auth.backends.ModelBackend", ) .values_list("email", flat=True) ),