Honor "safe for web app" flags for import/export handlers
This commit is contained in:
parent
cc4b2278e7
commit
092f1cda0c
|
@ -44,7 +44,12 @@
|
||||||
</once-button>
|
</once-button>
|
||||||
<b-button type="is-primary"
|
<b-button type="is-primary"
|
||||||
@click="submitRun()"
|
@click="submitRun()"
|
||||||
|
% if handler.safe_for_web_app:
|
||||||
:disabled="submittingRun"
|
:disabled="submittingRun"
|
||||||
|
% else:
|
||||||
|
disabled
|
||||||
|
title="Handler is not (yet) safe to run with this tool"
|
||||||
|
% endif
|
||||||
icon-pack="fas"
|
icon-pack="fas"
|
||||||
icon-left="arrow-circle-right">
|
icon-left="arrow-circle-right">
|
||||||
{{ submittingRun ? "Working, please wait..." : "Run this ${handler.direction.capitalize()}" }}
|
{{ submittingRun ? "Working, please wait..." : "Run this ${handler.direction.capitalize()}" }}
|
||||||
|
|
|
@ -129,6 +129,7 @@ class ImportingView(MasterView):
|
||||||
'handler_spec': handler.get_spec(),
|
'handler_spec': handler.get_spec(),
|
||||||
'direction': handler.direction,
|
'direction': handler.direction,
|
||||||
'direction_display': handler.direction.capitalize(),
|
'direction_display': handler.direction.capitalize(),
|
||||||
|
'safe_for_web_app': handler.safe_for_web_app,
|
||||||
}
|
}
|
||||||
|
|
||||||
if keep_handler:
|
if keep_handler:
|
||||||
|
@ -314,7 +315,13 @@ class ImportingView(MasterView):
|
||||||
|
|
||||||
if self.request.POST.get('runjob') == 'true':
|
if self.request.POST.get('runjob') == 'true':
|
||||||
|
|
||||||
# will invoke handler to run job
|
# will invoke handler to run job..
|
||||||
|
|
||||||
|
# ..but only if it is safe to do so
|
||||||
|
if not handler.safe_for_web_app:
|
||||||
|
self.request.session.flash("Handler is not (yet) safe to run "
|
||||||
|
"with this tool", 'error')
|
||||||
|
return self.redirect(self.request.current_route_url())
|
||||||
|
|
||||||
# TODO: this socket progress business was lifted from
|
# TODO: this socket progress business was lifted from
|
||||||
# tailbone.views.batch.core:BatchMasterView.handler_action
|
# tailbone.views.batch.core:BatchMasterView.handler_action
|
||||||
|
|
Loading…
Reference in a new issue