activity: basic webhook alerts for automation failures

This commit is contained in:
Iain Learmonth 2022-05-14 10:18:00 +01:00
parent eb372bec59
commit ac4f9b4942
12 changed files with 300 additions and 3 deletions

View file

@ -38,6 +38,13 @@ class AbstractResource(db.Model):
deprecation_reason = db.Column(db.String(), nullable=True)
destroyed = db.Column(db.DateTime(), nullable=True)
def __init__(self, **kwargs):
super().__init__(**kwargs)
if self.added is None:
self.added = datetime.utcnow()
if self.updated is None:
self.updated = datetime.utcnow()
def deprecate(self, *, reason: str):
self.deprecated = datetime.utcnow()
self.deprecation_reason = reason