mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-07 14:06:40 +00:00
Preserve localized backup status with vzdump inventory
This commit is contained in:
@@ -982,15 +982,18 @@ class EmailChannel(NotificationChannel):
|
|||||||
# ── Build structured detail rows from known data fields ──
|
# ── Build structured detail rows from known data fields ──
|
||||||
detail_rows = self._build_detail_rows(data, event_type, group, html_mod)
|
detail_rows = self._build_detail_rows(data, event_type, group, html_mod)
|
||||||
|
|
||||||
# Vzdump bodies are authoritative multi-item inventories. Structured
|
# Vzdump bodies are authoritative multi-item inventories. Keep their
|
||||||
# backup metadata is only a summary and previously replaced the body in
|
# lines exactly once, but retain the localized structured status row;
|
||||||
# the HTML alternative, hiding all guest rows. Render every body line
|
# the remaining structured backup metadata only duplicates the report.
|
||||||
# exactly once for these events instead of mixing both representations.
|
|
||||||
if event_type in {'backup_complete', 'backup_fail'}:
|
if event_type in {'backup_complete', 'backup_fail'}:
|
||||||
detail_rows = [
|
status_label = html_mod.escape(
|
||||||
|
_runtime_text('email.fields.status', data)
|
||||||
|
)
|
||||||
|
detail_rows = [row for row in detail_rows if row[0] == status_label]
|
||||||
|
detail_rows.extend(
|
||||||
('', html_mod.escape(line.strip()))
|
('', html_mod.escape(line.strip()))
|
||||||
for line in body.split('\n') if line.strip()
|
for line in body.split('\n') if line.strip()
|
||||||
]
|
)
|
||||||
|
|
||||||
# ── Fallback: if no structured rows, render body text lines ──
|
# ── Fallback: if no structured rows, render body text lines ──
|
||||||
if not detail_rows:
|
if not detail_rows:
|
||||||
|
|||||||
Reference in New Issue
Block a user