Auto-commit local changes before build (2026-01-08 15:10:32) #69

Merged
ivooskamp merged 1 commits from v20260108-34-runchecks-popup-mail-body into main 2026-01-13 11:27:29 +01:00
3 changed files with 33 additions and 2 deletions

View File

@ -1 +1 @@
v20260108-33-runchecks-success-override
v20260108-34-runchecks-popup-mail-body

View File

@ -22,6 +22,7 @@ from .routes_shared import (
get_active_role,
)
from ..database import db
from ..email_utils import extract_best_html_from_eml, is_effectively_blank_html
from ..models import (
Customer,
Job,
@ -618,7 +619,30 @@ def run_checks_details():
"subject": msg.subject or "",
"received_at": _format_datetime(msg.received_at),
}
body_html = msg.html_body or ""
def _is_blank_text(s):
return s is None or (isinstance(s, str) and s.strip() == "")
html_body = getattr(msg, "html_body", None)
text_body = getattr(msg, "text_body", None)
# Keep Run Checks consistent with Inbox/All Mail: if the Graph body is empty but the
# real report is stored as an HTML attachment inside the EML, extract it.
if is_effectively_blank_html(html_body) and _is_blank_text(text_body) and getattr(msg, "eml_blob", None):
extracted = extract_best_html_from_eml(getattr(msg, "eml_blob", None))
if extracted:
html_body = extracted
if not is_effectively_blank_html(html_body):
body_html = html_body
elif not _is_blank_text(text_body):
escaped = (
text_body.replace("&", "&")
.replace("<", "&lt;")
.replace(">", "&gt;")
)
body_html = f"<pre>{escaped}</pre>"
else:
body_html = "<p>No message content stored.</p>"
has_eml = bool(getattr(msg, "eml_stored_at", None))
objects_payload = []

View File

@ -63,6 +63,13 @@
- Updated UI logic so overridden runs are displayed with the blue success indicator.
- Ensured the override only affects the selected run and does not modify original run data.
---
## v20260108-34-runchecks-popup-mail-body
- Fixed Run Checks modal mail rendering by falling back to text_body when html_body is empty, matching Inbox/All Mail behavior.
- Added support to extract HTML content from stored EML when both html_body and text_body are blank (consistent with Inbox).
- Updated Run Checks details API to return a safe HTML body for plain-text emails using <pre> wrapping.
================================================================================================================================================
## v0.1.18