[paperwork] Add explicit backend to User.with_perms call

This commit is contained in:
Adam Goldsmith 2022-03-15 14:29:37 -04:00
parent 5ea485abf0
commit 6fad8d534e

View File

@ -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)
),