API: Allow request_valid_from in the past (#4048)

This commit is contained in:
Raphael Michel
2024-04-03 17:21:25 +02:00
committed by GitHub
parent 174c81a22b
commit a7735d5d9e
2 changed files with 26 additions and 1 deletions

View File

@@ -1315,7 +1315,7 @@ class OrderCreateSerializer(I18nAwareModelSerializer):
if 'valid_from' not in pos_data and 'valid_until' not in pos_data:
valid_from, valid_until = pos_data['item'].compute_validity(
requested_start=(
max(requested_valid_from, now())
requested_valid_from
if requested_valid_from and pos_data['item'].validity_dynamic_start_choice
else now()
),