core: replace uid with uuid search
uid can't be searched it as its a computed field closes #2480 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
3bdb551e74
commit
54f170650a
|
@ -199,7 +199,7 @@ class UsersFilter(FilterSet):
|
||||||
)
|
)
|
||||||
|
|
||||||
is_superuser = BooleanFilter(field_name="ak_groups", lookup_expr="is_superuser")
|
is_superuser = BooleanFilter(field_name="ak_groups", lookup_expr="is_superuser")
|
||||||
uid = CharFilter(field_name="uid")
|
uuid = CharFilter(field_name="uuid")
|
||||||
|
|
||||||
groups_by_name = ModelMultipleChoiceFilter(
|
groups_by_name = ModelMultipleChoiceFilter(
|
||||||
field_name="ak_groups__name",
|
field_name="ak_groups__name",
|
||||||
|
@ -249,7 +249,7 @@ class UserViewSet(UsedByMixin, ModelViewSet):
|
||||||
queryset = User.objects.none()
|
queryset = User.objects.none()
|
||||||
ordering = ["username"]
|
ordering = ["username"]
|
||||||
serializer_class = UserSerializer
|
serializer_class = UserSerializer
|
||||||
search_fields = ["username", "name", "is_active", "email", "uid"]
|
search_fields = ["username", "name", "is_active", "email", "uuid"]
|
||||||
filterset_class = UsersFilter
|
filterset_class = UsersFilter
|
||||||
|
|
||||||
def get_queryset(self): # pragma: no cover
|
def get_queryset(self): # pragma: no cover
|
||||||
|
|
|
@ -3037,11 +3037,11 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- in: query
|
- in: query
|
||||||
name: uid
|
name: username
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- in: query
|
- in: query
|
||||||
name: username
|
name: uuid
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
tags:
|
tags:
|
||||||
|
|
Reference in New Issue