Skip to content

Commit

Permalink
more debug and bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Nov 29, 2023
1 parent 69dfe63 commit 18e10be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/api/src/backend/services/Service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

class Service:
def __init__(self):
self.errors: list[str] = []
self.rollbacks = []
self.services = {}

Expand All @@ -13,6 +14,7 @@ def rollback(self, raise_exception=False):
rollback()
except Exception as e:
success = False
self.errors.append(str(e))
if raise_exception:
raise e

Expand Down
10 changes: 5 additions & 5 deletions src/api/src/backend/services/TaskService.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ def create(self, pipeline, request):
for key in request.input:
_input[key] = request.input[key].dict()

# Convert condition to jsonserializable

# Prepare the uses property
uses = getattr(request, "uses", None)
if uses != None:
Expand Down Expand Up @@ -321,9 +319,11 @@ def _recursive_pydantic_model_to_dict(self, obj):
return modified_dict
if isinstance(obj, BaseModel):
dict_obj = obj.dict()
for key in obj:
dict_obj[key] = self._recursive_pydantic_model_to_dict(dict_obj[key])
return dict_obj
print("IS INSTANCE", dict_obj, flush=True)
modified_dict = {}
for key in dict_obj:
modified_dict[key] = self._recursive_pydantic_model_to_dict(dict_obj[key])
return modified_dict

return obj

Expand Down

0 comments on commit 18e10be

Please sign in to comment.