Skip to content

Commit

Permalink
Remove execution profile from entity dict
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Jul 11, 2024
1 parent 06f2368 commit 51a68a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/api/src/backend/views/AddPipelineArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ def post(self, request, group_id, pipeline_id):
if archive == None:
return NotFound(message=f"Archive '{body.archive_id}' does not exist for group '{group_id}'")

# Repsond with archive not found
if archive == None:
return NotFound(message=f"Archive '{body.archive_id}' not found in group '{group_id}'")

try:
# Create the pipeline_archive
PipelineArchive.objects.create(
Expand Down
9 changes: 8 additions & 1 deletion src/api/src/backend/views/Tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,17 @@ def patch(self, request, group_id, pipeline_id, task_id):
if (task_model.type != task.type):
return BadRequest(f"Updating the type of a task is not allowed. Expected task.type: {task_model.type} - Recieved: {task.type}")

entity_dict = json.loads(task.json())
entity_dict = {
**entity_dict,
**entity_dict.execution_profile
}
del entity_dict["execution_profile"]

Task.objects.filter(
pipeline=pipeline,
id=task_id
).update(**json.loads(task.json()))
).update(**entity_dict)

return ModelResponse(Task.objects.filter(id=task.id, pipeline=pipeline).first())
except (DatabaseError, OperationalError, IntegrityError) as e:
Expand Down

0 comments on commit 51a68a0

Please sign in to comment.