Skip to content

Commit 08e4525

Browse files
committed
Fix serializer logic
1 parent 88a40a5 commit 08e4525

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llmstack/data/serializers.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ def get_refresh_interval(self, obj):
3636

3737
def get_has_source(self, obj):
3838
config = obj.config or {}
39-
return config.get("pipeline", {}).get("source", {}).get("slug", None) is not None
39+
source = config.get("pipeline", {}).get("source", {}) or {}
40+
return source.get("slug", None) is not None
4041

4142
def get_is_destination_only(self, obj):
4243
config = obj.config or {}
43-
return (
44-
config.get("pipeline", {}).get("destination", {}).get("slug", None) is not None
45-
and self.get_has_source(obj) is False
46-
)
44+
destination = config.get("pipeline", {}).get("destination", {}) or {}
45+
return destination.get("slug", None) is not None and self.get_has_source(obj) is False
4746

4847
class Meta:
4948
model = DataSource

0 commit comments

Comments
 (0)