From 2cc7f5ac13634ef07bc6eaa7994309f86eda3039 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Mon, 11 Jan 2021 12:35:54 +0100 Subject: [PATCH] only alert for contact that's created after the sanity date --- cron.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cron.py b/cron.py index 07aad136..42aea78d 100644 --- a/cron.py +++ b/cron.py @@ -438,12 +438,16 @@ def sanity_check(): db.session.commit() LOG.exception("Alias %s name contains linebreak %s", alias, alias.name) + contact_email_sanity_date = arrow.get("2021-01-12") for contact in Contact.query.all(): if sanitize_email(contact.reply_email) != contact.reply_email: LOG.exception("Contact %s reply-email not sanitized", contact) - if sanitize_email(contact.website_email) != contact.website_email: - LOG.exception("Contact %s reply-email not sanitized", contact) + if ( + sanitize_email(contact.website_email) != contact.website_email + and contact.created_at > contact_email_sanity_date + ): + LOG.exception("Contact %s website-email not sanitized", contact) if not contact.invalid_email and not is_valid_email(contact.website_email): LOG.exception("%s invalid email", contact)