I also only discovered the buttons when looking into this issue. I agree this is unrelated to the pull request, just wrote down the comment to keep track of my thought.

I also see that (some of) the complexity is intrinsic to the problem.

Good point about the clever redirects. However you can probably also apply that cleverness when initially rendering the form and not only on submitting it. After all canceling the form does not change the data at all.

After merging the pull request I think we should make sure there are tests for all code paths here and I might give refactoring it a try - just to see if it can be done.