Skip to content

Commit

Permalink
redirect when creating incident has been changed (#112)
Browse files Browse the repository at this point in the history
redirect when creating incident has been changed

Reviewed-by: Vladimir Hasko <[email protected]>
  • Loading branch information
bakhterets authored Apr 26, 2024
1 parent 9fdaeef commit 44a2f27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/web/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 44a2f27

Please sign in to comment.