Skip to content

Commit

Permalink
core: fix generic sources not being fetchable by pk (#12896)
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <[email protected]>
  • Loading branch information
BeryJu authored Jan 31, 2025
1 parent f1b7a9f commit 6d152bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions authentik/core/api/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from authentik.core.api.utils import MetaNameSerializer, ModelSerializer
from authentik.core.models import GroupSourceConnection, Source, UserSourceConnection
from authentik.core.types import UserSettingSerializer
from authentik.lib.api import MultipleFieldLookupMixin
from authentik.lib.utils.file import (
FilePathSerializer,
FileUploadSerializer,
Expand Down Expand Up @@ -75,6 +76,7 @@ class Meta:


class SourceViewSet(
MultipleFieldLookupMixin,
TypesMixin,
mixins.RetrieveModelMixin,
mixins.DestroyModelMixin,
Expand All @@ -87,6 +89,7 @@ class SourceViewSet(
queryset = Source.objects.none()
serializer_class = SourceSerializer
lookup_field = "slug"
lookup_fields = ["slug", "pbm_uuid"]
search_fields = ["slug", "name"]
filterset_fields = ["slug", "name", "managed"]

Expand Down

0 comments on commit 6d152bc

Please sign in to comment.