Commit 2f0519e5 authored by Janez K's avatar Janez K

checks are performed before running widgets

parent 606adddf
......@@ -998,6 +998,10 @@ def run_widget(request):
w = get_object_or_404(Widget, pk=request.POST['widget_id'])
if (w.workflow.user==request.user):
try:
# find all required inputs
for inp in w.inputs.filter(required=True,parameter=False):
if inp.connections.count()==0:
raise Exception("The input "+str(inp)+" must have something connected to it in order to run.")
if w.type == 'for_input' or w.type == 'for_output':
raise Exception("You can't run for loops like this. Please run the containing widget.")
output_dict = w.run(False)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment