fix notification template: crew notes as cause, weather as live conditions

This commit is contained in:
2026-04-15 23:09:03 -03:00
parent a144a362d1
commit d5cabe4f22

View File

@@ -67,9 +67,9 @@ def _template_notification(context: dict) -> str:
"", "",
] ]
if weather_summary: if crew_notes_summary:
lines.append(f"Your flight is delayed due to {weather_summary}.") lines.append(crew_notes_summary)
elif delay_cause: if delay_cause:
cause_text = { cause_text = {
"WEATHER": "weather conditions along your route", "WEATHER": "weather conditions along your route",
"MAINTENANCE": "a routine maintenance check on your aircraft", "MAINTENANCE": "a routine maintenance check on your aircraft",
@@ -77,10 +77,10 @@ def _template_notification(context: dict) -> str:
"ATC": "air traffic control restrictions", "ATC": "air traffic control restrictions",
"LATE_AIRCRAFT": "the late arrival of your inbound aircraft", "LATE_AIRCRAFT": "the late arrival of your inbound aircraft",
}.get(delay_cause, f"{delay_cause.lower()}") }.get(delay_cause, f"{delay_cause.lower()}")
lines.append(f"Your flight is delayed due to {cause_text}.") if not crew_notes_summary:
lines.append(f"Your flight is delayed due to {cause_text}.")
if crew_notes_summary: if weather_summary:
lines.append(crew_notes_summary) lines.append(f"Current conditions: {weather_summary}.")
if gate: if gate:
lines.append(f"\nGate {gate} — no gate change expected.") lines.append(f"\nGate {gate} — no gate change expected.")