Fix some bad logic in the change_form_submit_buttons template tag.
Review Request #11349 — Created Dec. 23, 2020 and submitted — Latest diff uploaded
The new
change_form_submit_buttonstemplate tag had some bad logic in
it that could lead to a failure when adding new objects. It made two bad
assumptions:
changewas an object (it's abool)- It could always compute a delete URL (it can't if
 change == False).This change fixes up the logic to treat
changecorrectly and to only
generate a delete URL if we know we're showing the link.
Re-tested all types of pages, including change forms creating a new object.
Unit tests pass.