Skip to content

Commit

Permalink
Serialize task output on task create
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Aug 16, 2024
1 parent 02f79b0 commit 2228788
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/src/backend/services/TaskService.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ def create(self, pipeline, request):
self.rollback()
raise e

# Convert the input to jsonserializable
# Convert the input and output to jsonserializable
_input = {}
for key in request.input:
_input[key] = request.input[key].dict()

output = {}
for key in request.output:
output[key] = request.output[key].dict()

# Prepare the uses property
uses = getattr(request, "uses", None)
if uses != None:
Expand Down Expand Up @@ -111,7 +115,7 @@ def create(self, pipeline, request):
input=_input,
installer=getattr(request, "installer", None),
id=request.id,
output=request.output,
output=output,
packages=getattr(request, "packages", None),
pipeline=pipeline,
poll=getattr(request, "poll", None),
Expand Down

0 comments on commit 2228788

Please sign in to comment.