From 18953fde8e6cac1a6e77c05d569def649a6d64bb Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Wed, 27 May 2026 18:05:40 +0200 Subject: [PATCH] Color metadata embed orange when report has parse errors --- dmarc_to_discord.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dmarc_to_discord.py b/dmarc_to_discord.py index 969eee4..96b4adb 100644 --- a/dmarc_to_discord.py +++ b/dmarc_to_discord.py @@ -84,11 +84,12 @@ def build_metadata_embed(report): "value": f"**Records:** {len(records)}\n**Messages:** {total}\n**DMARC pass:** {passing} / {total}", "inline": False}, ] - if errors := (meta.get("errors") or []): + errors = meta.get("errors") or [] + if errors: fields.append({"name": "Errors", "value": truncate("\n".join(f"• {e}" for e in errors)), "inline": False}) return {"title": f"DMARC Aggregate Report — {policy.get('domain', 'unknown')}", - "color": COLOR_INFO, "fields": fields} + "color": COLOR_PARTIAL if errors else COLOR_INFO, "fields": fields} def diagnose_record(record):