From ad4418de297a6a6fa476fd95b10c01973b2ef232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Sun, 16 Jun 2024 09:07:15 +0200 Subject: [PATCH] [IMP]pms_api_rest: autofix past dates to send api client info --- pms_api_rest/models/pms_property.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pms_api_rest/models/pms_property.py b/pms_api_rest/models/pms_property.py index 37a585839..a8034bf08 100644 --- a/pms_api_rest/models/pms_property.py +++ b/pms_api_rest/models/pms_property.py @@ -586,11 +586,11 @@ class PmsProperty(models.Model): if isinstance(date_from, str): date_from = datetime.datetime.strptime(date_from, "%Y-%m-%d").date() if date_from < datetime.datetime.today().date(): - raise ValidationError(_("Invalid date from")) + date_from = datetime.datetime.today().date() if isinstance(date_to, str): date_to = datetime.datetime.strptime(date_to, "%Y-%m-%d").date() if date_to <= date_from: - raise ValidationError(_("Invalid date to")) + date_to = date_from for client in clients: if not pms_property_codes: pms_properties = client.pms_property_ids