In this case, I would just wrap `grade` with the `commit_on_success` as a decorator.