def get_task_raw(task_id): try: task = Task.get(task_id) except StatementError: raise TaskNotFoundException() if task is None: raise TaskNotFoundException() return task