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:
counterweight 2025-12-21 17:28:21 +01:00
parent 63cf46c230
commit 19c313767c
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 17 additions and 0 deletions

View file

@ -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)