diff --git a/src/registrar/admin.py b/src/registrar/admin.py index 86234431d..0b7553c30 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -838,13 +838,19 @@ def lookups(self, request, model_admin): ) # Annotate the full name and return a values list that lookups can use - privileged_users_annotated = privileged_users.annotate( - full_name=Coalesce( - Concat("investigator__first_name", Value(" "), "investigator__last_name", output_field=CharField()), - "investigator__email", - output_field=CharField(), + privileged_users_annotated = ( + privileged_users.annotate( + full_name=Coalesce( + Concat( + "investigator__first_name", Value(" "), "investigator__last_name", output_field=CharField() + ), + "investigator__email", + output_field=CharField(), + ) ) - ).values_list("investigator__id", "full_name") + .values_list("investigator__id", "full_name") + .distinct() + ) return privileged_users_annotated