diff --git a/authentik/api/templates/api/swagger.html b/authentik/api/templates/api/swagger.html index f79c37309..133f6f86f 100644 --- a/authentik/api/templates/api/swagger.html +++ b/authentik/api/templates/api/swagger.html @@ -15,6 +15,7 @@ authentik API Browser spec-url="{{ path }}" heading-text="authentik" theme="dark" + render-style="view" primary-color="#fd4b2d" allow-spec-url-load="false" allow-spec-file-load="false"> diff --git a/authentik/policies/api/bindings.py b/authentik/policies/api/bindings.py index a10f1d968..8a69ca9f5 100644 --- a/authentik/policies/api/bindings.py +++ b/authentik/policies/api/bindings.py @@ -102,8 +102,8 @@ class PolicyBindingViewSet(ModelViewSet): """PolicyBinding Viewset""" queryset = PolicyBinding.objects.all().select_related( - "policy", "target", "group", "user" - ) + "target", "group", "user" + ).prefetch_related("policy") # prefetching policy so we resolve the subclass serializer_class = PolicyBindingSerializer filterset_fields = ["policy", "target", "enabled", "order", "timeout"] search_fields = ["policy__name"]