From 8cd1223081cf1d2241193b31185f5eb8e8dab4e7 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 22 Jul 2021 20:10:37 +0200 Subject: [PATCH] core: add email filter for user Signed-off-by: Jens Langhammer --- authentik/core/api/users.py | 11 +++++++++-- schema.yml | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/authentik/core/api/users.py b/authentik/core/api/users.py index f334fd8db..a3733e65e 100644 --- a/authentik/core/api/users.py +++ b/authentik/core/api/users.py @@ -128,7 +128,14 @@ class UsersFilter(FilterSet): class Meta: model = User - fields = ["username", "name", "is_active", "is_superuser", "attributes"] + fields = [ + "username", + "email", + "name", + "is_active", + "is_superuser", + "attributes", + ] class UserViewSet(UsedByMixin, ModelViewSet): @@ -136,7 +143,7 @@ class UserViewSet(UsedByMixin, ModelViewSet): queryset = User.objects.none() serializer_class = UserSerializer - search_fields = ["username", "name", "is_active"] + search_fields = ["username", "name", "is_active", "email"] filterset_class = UsersFilter def get_queryset(self): # pragma: no cover diff --git a/schema.yml b/schema.yml index eea9947db..5af8b357b 100644 --- a/schema.yml +++ b/schema.yml @@ -2843,6 +2843,10 @@ paths: schema: type: string description: Attributes + - in: query + name: email + schema: + type: string - in: query name: is_active schema: