activity: basic webhook alerts for automation failures
This commit is contained in:
parent
eb372bec59
commit
ac4f9b4942
12 changed files with 300 additions and 3 deletions
|
@ -4,6 +4,7 @@ from wtforms import SubmitField
|
|||
|
||||
from app import db
|
||||
from app.models import AbstractResource
|
||||
from app.models.activity import Activity
|
||||
|
||||
|
||||
def response_404(message: str):
|
||||
|
@ -37,7 +38,13 @@ def view_lifecycle(*,
|
|||
else:
|
||||
flash("Unknown action")
|
||||
return redirect(url_for("portal.portal_home"))
|
||||
activity = Activity(
|
||||
activity_type="lifecycle",
|
||||
text=f"Portal action: {message}. {success_message}"
|
||||
)
|
||||
db.session.add(activity)
|
||||
db.session.commit()
|
||||
activity.notify()
|
||||
flash(success_message, "success")
|
||||
return redirect(url_for(success_view))
|
||||
return render_template("lifecycle.html.j2",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue