diff --git a/src/api/src/backend/services/Service.py b/src/api/src/backend/services/Service.py index 9b878fc2..88d91343 100644 --- a/src/api/src/backend/services/Service.py +++ b/src/api/src/backend/services/Service.py @@ -3,6 +3,7 @@ class Service: def __init__(self): + self.errors: list[str] = [] self.rollbacks = [] self.services = {} @@ -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 diff --git a/src/api/src/backend/services/TaskService.py b/src/api/src/backend/services/TaskService.py index 54da1e23..f33cbb14 100644 --- a/src/api/src/backend/services/TaskService.py +++ b/src/api/src/backend/services/TaskService.py @@ -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: @@ -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