From 44a2f27d6dc676bb7ccca2a0547d1400e18cfe9d Mon Sep 17 00:00:00 2001 From: Ilia Bakhterev <39965096+bakhterets@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:45:17 +0200 Subject: [PATCH] redirect when creating incident has been changed (#112) redirect when creating incident has been changed Reviewed-by: Vladimir Hasko --- app/web/routes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/web/routes.py b/app/web/routes.py index 632f124..78875e4 100644 --- a/app/web/routes.py +++ b/app/web/routes.py @@ -142,7 +142,8 @@ def new_incident(current_user): if messages_from: update_incident(new_incident, ', '.join(messages_from)) db.session.commit() - return redirect("/") + return (redirect("/") if new_incident.impact != 0 + else redirect("/incidents/" + str(new_incident.id))) return render_template( "create_incident.html", title="Open Incident", form=form )