core: add email filter for user
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
1b4654bb1d
commit
8cd1223081
|
@ -128,7 +128,14 @@ class UsersFilter(FilterSet):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = ["username", "name", "is_active", "is_superuser", "attributes"]
|
fields = [
|
||||||
|
"username",
|
||||||
|
"email",
|
||||||
|
"name",
|
||||||
|
"is_active",
|
||||||
|
"is_superuser",
|
||||||
|
"attributes",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class UserViewSet(UsedByMixin, ModelViewSet):
|
class UserViewSet(UsedByMixin, ModelViewSet):
|
||||||
|
@ -136,7 +143,7 @@ class UserViewSet(UsedByMixin, ModelViewSet):
|
||||||
|
|
||||||
queryset = User.objects.none()
|
queryset = User.objects.none()
|
||||||
serializer_class = UserSerializer
|
serializer_class = UserSerializer
|
||||||
search_fields = ["username", "name", "is_active"]
|
search_fields = ["username", "name", "is_active", "email"]
|
||||||
filterset_class = UsersFilter
|
filterset_class = UsersFilter
|
||||||
|
|
||||||
def get_queryset(self): # pragma: no cover
|
def get_queryset(self): # pragma: no cover
|
||||||
|
|
|
@ -2843,6 +2843,10 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
description: Attributes
|
description: Attributes
|
||||||
|
- in: query
|
||||||
|
name: email
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
- in: query
|
- in: query
|
||||||
name: is_active
|
name: is_active
|
||||||
schema:
|
schema:
|
||||||
|
|
Reference in New Issue