From 4ed9a4353394d363e3195d10386ae156dba0769b Mon Sep 17 00:00:00 2001 From: Roman Kysil Date: Mon, 2 Dec 2024 15:17:52 +0100 Subject: [PATCH] Change day validation priority --- CHANGES.rst | 3 ++- .../prenotazioni/browser/prenotazioni_context_state.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 26c18624..f687178e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,8 @@ Changelog 2.8.4 (unreleased) ------------------ -- Nothing changed yet. +- Fix first available day result. + [folix-01] 2.8.3 (2024-11-28) diff --git a/src/redturtle/prenotazioni/browser/prenotazioni_context_state.py b/src/redturtle/prenotazioni/browser/prenotazioni_context_state.py index 8a5ea422..5d6d9f4a 100644 --- a/src/redturtle/prenotazioni/browser/prenotazioni_context_state.py +++ b/src/redturtle/prenotazioni/browser/prenotazioni_context_state.py @@ -311,6 +311,9 @@ def is_valid_day(self, day, bypass_user_restrictions=False): is_configured_day = self.is_configured_day(day) + if self.is_vacation_day(day): + return False + if bypass_user_restrictions: return True @@ -324,9 +327,6 @@ def is_valid_day(self, day, bypass_user_restrictions=False): if day < self.first_bookable_day: return False - if self.is_vacation_day(day): - return False - if self.last_bookable_day and day > self.last_bookable_day: return False