From 35ec65cfc96cb6a10455d3b7b3ed3ad9eafccd53 Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Wed, 15 May 2024 16:51:05 +0200 Subject: [PATCH] fix: correct "or" filter for functions of user to an "and" filter #356 --- backend/api/views/user_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/api/views/user_view.py b/backend/api/views/user_view.py index 3a65fa37..9d8b33a2 100644 --- a/backend/api/views/user_view.py +++ b/backend/api/views/user_view.py @@ -57,7 +57,7 @@ def search(self, request: Request) -> Response: role_filters = Q() for role in roles: - role_filters |= Q(**{f"{role}__isnull": False, f"{role}__is_active": True}) + role_filters &= Q(**{f"{role}__isnull": False, f"{role}__is_active": True}) queryset = queryset.filter( role_filters,