Color metadata embed orange when report has parse errors
This commit is contained in:
+3
-2
@@ -84,11 +84,12 @@ def build_metadata_embed(report):
|
|||||||
"value": f"**Records:** {len(records)}\n**Messages:** {total}\n**DMARC pass:** {passing} / {total}",
|
"value": f"**Records:** {len(records)}\n**Messages:** {total}\n**DMARC pass:** {passing} / {total}",
|
||||||
"inline": False},
|
"inline": False},
|
||||||
]
|
]
|
||||||
if errors := (meta.get("errors") or []):
|
errors = meta.get("errors") or []
|
||||||
|
if errors:
|
||||||
fields.append({"name": "Errors",
|
fields.append({"name": "Errors",
|
||||||
"value": truncate("\n".join(f"• {e}" for e in errors)), "inline": False})
|
"value": truncate("\n".join(f"• {e}" for e in errors)), "inline": False})
|
||||||
return {"title": f"DMARC Aggregate Report — {policy.get('domain', 'unknown')}",
|
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):
|
def diagnose_record(record):
|
||||||
|
|||||||
Reference in New Issue
Block a user