Fallback to referrer if form has no cancel button URL

This commit is contained in:
Lance Edgar 2019-11-07 22:56:56 -06:00
parent 8dcec94aec
commit 0877cfc3c9

View file

@ -63,11 +63,11 @@
${h.link_to("Cancel", form.cancel_url, class_='ui-btn ui-corner-all')}
% else:
% if form.auto_disable_cancel:
<once-button tag="a" href="${form.cancel_url}"
<once-button tag="a" href="${form.cancel_url or request.get_referrer()}"
text="Cancel">
</once-button>
% else:
<b-button tag="a" href="${form.cancel_url}">
<b-button tag="a" href="${form.cancel_url or request.get_referrer()}">
Cancel
</b-button>
% endif