From 744de5cb47d418a720c5cbce55bf458394022b2b Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Wed, 15 Jan 2020 01:24:44 +0500 Subject: [PATCH] Fix #10 --- project_amber/controllers/task.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project_amber/controllers/task.py b/project_amber/controllers/task.py index d577a7f..bde7103 100644 --- a/project_amber/controllers/task.py +++ b/project_amber/controllers/task.py @@ -78,6 +78,9 @@ def update_task(self, task_id: int, data: dict) -> int: """ task = self.get_task(task_id) new_details = Task(self.user.id, data) + # will drop 404 on a non-existent PID + # TODO: a little too hackish + self.get_task(new_details.parent_id) task.merge(new_details) if not new_details.parent_id is None: if new_details.parent_id == 0: