Skip to content

Commit 88a40a5

Browse files
committed
Fix serilizer logic
1 parent beb9467 commit 88a40a5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

llmstack/data/serializers.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@ def get_type(self, obj):
2626
"name": "Custom",
2727
}
2828

29-
def _get_config(self, obj):
30-
return obj.config or {}
31-
3229
def get_pipeline(self, obj):
33-
return self._get_config(obj=obj).get("pipeline", None)
30+
config = obj.config or {}
31+
return config.get("pipeline", None)
3432

3533
def get_refresh_interval(self, obj):
36-
return self._get_config(obj=obj).get("refresh_interval", None)
34+
config = obj.config or {}
35+
return config.get("refresh_interval", None)
3736

3837
def get_has_source(self, obj):
39-
return self._get_config(obj=obj).get("pipeline", {}).get("source", {}).get("slug", None) is not None
38+
config = obj.config or {}
39+
return config.get("pipeline", {}).get("source", {}).get("slug", None) is not None
4040

4141
def get_is_destination_only(self, obj):
42+
config = obj.config or {}
4243
return (
43-
self._get_config(obj=obj).get("pipeline", {}).get("destination", {}).get("slug", None) is not None
44+
config.get("pipeline", {}).get("destination", {}).get("slug", None) is not None
4445
and self.get_has_source(obj) is False
4546
)
4647

0 commit comments

Comments
 (0)