Description
The self-schedule end date calculation has two bugs:
ssm_deadline_hour is a string from config but passed directly to datetime.replace(hour=...) which requires an integer, causing a TypeError.
- Even if cast to int, if the user requests at 22:00 and the deadline hour is 21:00,
days_ahead could be 0, making end before start, causing valid requests to be rejected.
Affected Code
# src/quads/server/blueprints/schedules.py:248-262
ssm_deadline_hour = Config.get("ssm_deadline_hour", "21") # returns string "21"
end = start.replace(hour=ssm_deadline_hour, minute=0, second=0, microsecond=0) + timedelta(days=days_ahead)
Impact
- TypeError crash when self-scheduling is attempted
- Valid scheduling requests rejected due to end date before start date
Recommended Fix
- Cast
ssm_deadline_hour to int: int(Config.get("ssm_deadline_hour", "21"))
- Fix the logic to ensure
end is always after start, e.g., if computed end < start, advance by one more day.
Description
The self-schedule end date calculation has two bugs:
ssm_deadline_houris a string from config but passed directly todatetime.replace(hour=...)which requires an integer, causing aTypeError.days_aheadcould be 0, makingendbeforestart, causing valid requests to be rejected.Affected Code
Impact
Recommended Fix
ssm_deadline_hourto int:int(Config.get("ssm_deadline_hour", "21"))endis always afterstart, e.g., if computedend < start, advance by one more day.