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