Fix: Validate source_date in copy availability endpoint
Added validation to ensure source_date is within the allowed range (tomorrow to +30 days) for consistency with target_dates validation.
This commit is contained in:
parent
63cf46c230
commit
19c313767c
2 changed files with 17 additions and 0 deletions
|
|
@ -141,6 +141,9 @@ async def copy_availability(
|
|||
"""Copy availability from one day to multiple target days."""
|
||||
min_date, max_date = _get_date_range_bounds()
|
||||
|
||||
# Validate source date is in range (for consistency, though DB query would fail anyway)
|
||||
_validate_date_in_range(request.source_date, min_date, max_date)
|
||||
|
||||
# Validate target dates
|
||||
for target_date in request.target_dates:
|
||||
_validate_date_in_range(target_date, min_date, max_date)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue