def get(self, task_id): """ Deletes task """ task = TaskModel.find_by(task_id) if task is None: return {"message": "Invalid task id"}, 400 return {'logs': task.logs}
def delete(self, task_id): """ Deletes task """ task = TaskModel.find_by(task_id) if task is None: return {"message": "Invalid task id"}, 400 if not task.completed: return {"message": "Task is not completed"}, 400 task.delete() return {"success": True}