Skip to content

Commit

Permalink
Debug task patch
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Jul 10, 2024
1 parent 14a1c4b commit c02c5ec
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/api/src/backend/serializers/FunctionTaskSerializer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from backend.serializers import FunctionTaskSerializer

class FunctionTaskSerializer:
@staticmethod
def serialize(model):
return
7 changes: 7 additions & 0 deletions src/api/src/backend/serializers/TaskSerializer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from backend.serializers import FunctionTaskSerializer

class TaskSerializer:
@staticmethod
def serialize(model):
if model.type == "function":
return FunctionTaskSerializer.serialize(model)
4 changes: 3 additions & 1 deletion src/api/src/backend/serializers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from backend.serializers.UUIDSerializer import UUIDSerializer
from backend.serializers.PipelineLockModelSerializer import PipelineLockModelSerializer
from backend.serializers.PipelineLockAcquisitionResponseSerializer import PipelineLockAcquisitionResponseSerializer
from backend.serializers.PipelineLockAcquisitionResponseSerializer import PipelineLockAcquisitionResponseSerializer
from backend.serializers.TaskSerializer import TaskSerializer
from backend.serializers.FunctionTaskSerializer import FunctionTaskSerializer
9 changes: 7 additions & 2 deletions src/api/src/backend/views/Tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import json
import json, pprint

from django.db import IntegrityError, OperationalError, DatabaseError
from django.forms import model_to_dict
Expand Down Expand Up @@ -131,8 +131,13 @@ def patch(self, request, group_id, pipeline_id, task_id):
# Resolve the the proper pydantic object for this task type
TaskSchema = task_service.resolve_request_type(task_model.type)

serialized_task = model_to_dict(task_model)

print(serialized_task)
pprint(serialized_task)

task = TaskSchema(**{
**model_to_dict(task_model),
**serialized_task,
**self.request_body
})

Expand Down

0 comments on commit c02c5ec

Please sign in to comment.