diff --git a/authentik/core/api/users.py b/authentik/core/api/users.py index 623e919dd..013d82685 100644 --- a/authentik/core/api/users.py +++ b/authentik/core/api/users.py @@ -212,6 +212,7 @@ class UserViewSet(UsedByMixin, ModelViewSet): """User Viewset""" queryset = User.objects.none() + ordering = ["username"] serializer_class = UserSerializer search_fields = ["username", "name", "is_active", "email"] filterset_class = UsersFilter diff --git a/authentik/flows/api/flows.py b/authentik/flows/api/flows.py index 602cc4654..332e525d6 100644 --- a/authentik/flows/api/flows.py +++ b/authentik/flows/api/flows.py @@ -108,6 +108,7 @@ class FlowViewSet(UsedByMixin, ModelViewSet): queryset = Flow.objects.all() serializer_class = FlowSerializer lookup_field = "slug" + ordering = ["slug", "name"] search_fields = ["name", "slug", "designation", "title"] filterset_fields = ["flow_uuid", "name", "slug", "designation"] diff --git a/authentik/policies/api/policies.py b/authentik/policies/api/policies.py index 3d3753802..094f894b6 100644 --- a/authentik/policies/api/policies.py +++ b/authentik/policies/api/policies.py @@ -87,6 +87,7 @@ class PolicyViewSet( "promptstage": ["isnull"], } search_fields = ["name"] + ordering = ["name"] def get_queryset(self): # pragma: no cover return Policy.objects.select_subclasses().prefetch_related("bindings", "promptstage_set")