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