Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Merge f92fa33 into 921b4d0
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgazoni committed Jun 9, 2019
2 parents 921b4d0 + f92fa33 commit 1c3fa93
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion kirby/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
level=logging.DEBUG,
format=getenv("LOG_FORMAT", default=DEFAULT_LOG_FORMAT),
)
logging.getLogger("kafka").setLevel(logging.CRITICAL)

for ignored in ("kafka", "passlib.registry"):
logging.getLogger(ignored).setLevel(logging.CRITICAL)

logger = logging.getLogger(__name__)

Expand Down
14 changes: 13 additions & 1 deletion kirby/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ class Notification(db.Model):

on_retry = db.Column(db.Boolean, nullable=False, default=False)
on_failure = db.Column(db.Boolean, nullable=False, default=True)
on_missed_mark = db.Column(db.Boolean, nullable=False, default=True)

job_id = db.Column(db.Integer, db.ForeignKey("job.id"), nullable=False)
job = db.relationship(Job, backref=db.backref("notifications", lazy=True))
Expand All @@ -267,7 +268,18 @@ class Notification(db.Model):
)

def __repr__(self):
return f"{self.job} -> {','.join(g.name for g in self.groups)}"
on = []
if self.on_retry:
on.append("retry")
if self.on_failure:
on.append("failure")
if self.on_missed_mark:
on.append("missed mark")

return "%s for {%s}" % (
", ".join(g.name for g in self.groups),
", ".join(on),
)


class Script(db.Model):
Expand Down

0 comments on commit 1c3fa93

Please sign in to comment.