DeleteView: how to specify the URL if the user cancels?

I have a view based on DeleteView that works perfectly if the user agrees to the deletion, but goes to the wrong URL if the user cancels the deletion. Is there a way to specify the cancel URL (similar to how I override get_success_url() to provide the URL if the user OKs the deletion)?

More detail: I have a Tune model, and each Tune can have one or more Scores. The code in question deletes a Score using URL tune/<int:pk>/delete_score (overriding the get_success_url method to get there). But when the user cancels the deletion, the user is sent to URL tune/<int:pk>/edit, which is wrong (and can’t be made right, because that URL is already used for another purpose: going to a tune without specifying the score).

Perhaps I should use an EditView instead, and delete the object in the form_valid method. This needs a bit more hand coding, but has the advantage that if I put up my own confirmation dialog box in response to clicking the delete button, I can do nothing if the user cancels – I will still be on the page that shows the delete button. Still…it has disadvantages, such as getting to the delete URL some other way will have no confirmation.

I think we need a little more context, because it’s hard to visualise exactly what’s happening from this description. Can you share the DeleteView, and the template that includes however it is the user can choose to cancel?

Looking more closely at the template, I found it. There’s a cancel button with an href. Thanks!

For the record, I plan to change the score delete URL to score/<int:pk>/delete and the edit URL to score/<int:pk>edit even though the page allows editing of both the tune and score.