From 2580371f94433bb83c6401ec2d19b2dbc1440312 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 14 Jun 2021 12:38:29 +0200 Subject: [PATCH] outposts: fix error when getting component for base service connection Signed-off-by: Jens Langhammer --- authentik/outposts/api/service_connections.py | 7 +++++++ authentik/outposts/models.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/authentik/outposts/api/service_connections.py b/authentik/outposts/api/service_connections.py index 566ed7dd6..5e722aae3 100644 --- a/authentik/outposts/api/service_connections.py +++ b/authentik/outposts/api/service_connections.py @@ -33,6 +33,13 @@ class ServiceConnectionSerializer(ModelSerializer, MetaNameSerializer): component = ReadOnlyField() + def get_component(self, obj: OutpostServiceConnection) -> str: + """Get object type so that we know how to edit the object""" + # pyright: reportGeneralTypeIssues=false + if obj.__class__ == OutpostServiceConnection: + return "" + return obj.component + class Meta: model = OutpostServiceConnection diff --git a/authentik/outposts/models.py b/authentik/outposts/models.py index af99e7b5c..3ce9659c1 100644 --- a/authentik/outposts/models.py +++ b/authentik/outposts/models.py @@ -143,7 +143,7 @@ class OutpostServiceConnection(models.Model): @property def component(self) -> str: """Return component used to edit this object""" - return "" + raise NotImplementedError class Meta: