outposts: fix error when getting component for base service connection
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
4e9be85353
commit
2580371f94
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
Reference in New Issue