Show shift type label for both weekend shifts in notifications

Night shift notifications on weekends were missing the type label,
making them ambiguous. Also fix schedule post text fallback to use
this_monday instead of now for the start date.
This commit is contained in:
Adam Moussa 2026-05-12 17:23:51 -04:00
parent 98631a3b2f
commit 889a1b307c
2 changed files with 4 additions and 2 deletions

View file

@ -131,7 +131,9 @@ def build_shift_change_message(
dt = datetime.strptime(date_str, "%Y-%m-%d")
day_label = dt.strftime("%A, %b %-d")
type_label = (
f" ({SHIFT_LABELS.get(shift_type, shift_type)})" if shift_type == "day" else ""
f" ({SHIFT_LABELS.get(shift_type, shift_type)})"
if dt.strftime("%A") in WEEKEND_DAYS
else ""
)
if action == "picked_up":

View file

@ -252,7 +252,7 @@ def create_app(
channel=channel,
ts=post["message_ts"],
blocks=blocks,
text=f"After-Hours Schedule — {now.strftime('%b %-d')} to {end_date.strftime('%b %-d')}",
text=f"After-Hours Schedule — {this_monday.strftime('%b %-d')} to {end_date.strftime('%b %-d')}",
)
except Exception:
logger.warning("Could not update schedule post", exc_info=True)