Example #1
0
 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}
Example #2
0
    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}