1
0
Fork 0
mirror of https://github.com/ethauvin/fail2ban-digest.git synced 2025-04-26 10:58:12 -07:00

Add cosmetic message when no even is recorded

This commit is contained in:
Enrico Tagliavini 2017-06-23 11:35:37 +02:00
parent ad8670c376
commit 45eaab6f60

View file

@ -149,6 +149,8 @@ def mail_digest(db, mail_to, mail_from, delete):
msg = EmailMessage()
date_now = datetime.utcnow().strftime(db_date_format)
creation_date, dgst = digest(db, delete)
if dgst == '':
dgst = 'no ban event recorded for the named time frame'
msg.set_content(default_mail_template.substitute(
creation_date = creation_date,
date_now = date_now,