flows: fix error when opening inspector with no history
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
f1b143606e
commit
13d975a258
|
@ -105,7 +105,7 @@ class FlowInspectorView(APIView):
|
||||||
current_plan: FlowPlan = request.session[SESSION_KEY_PLAN]
|
current_plan: FlowPlan = request.session[SESSION_KEY_PLAN]
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
current_plan = request.session[SESSION_KEY_HISTORY][-1]
|
current_plan = request.session.get(SESSION_KEY_HISTORY, [])[-1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return Response(status=400)
|
return Response(status=400)
|
||||||
is_completed = True
|
is_completed = True
|
||||||
|
|
Reference in a new issue