Fix some bad logic in the change_form_submit_buttons template tag.

Review Request #11349 — Created Dec. 23, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

The new change_form_submit_buttons template tag had some bad logic in
it that could lead to a failure when adding new objects. It made two bad
assumptions:

  1. change was an object (it's a bool)
  2. It could always compute a delete URL (it can't if change == False).

This change fixes up the logic to treat change correctly 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.

Summary ID
Fix some bad logic in the change_form_submit_buttons template tag.
The new `change_form_submit_buttons` template tag had some bad logic in it that could lead to a failure when adding new objects. It made two bad assumptions: 1. `change` was an object (it's a `bool`) 2. It could always compute a delete URL (it can't if `change == False`). This change fixes up the logic to treat `change` correctly and to only generate a delete URL if we know we're showing the link.
f0201bd6645ab676e9cf1e180c48cad8171479c8
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (e18522d)