On accepte les heures de fin avec une chaine nulle ('')

Fix #358
This commit is contained in:
Jean-Marie Favreau 2025-03-10 18:54:59 +01:00
parent d31014809d
commit faa72867c5

View File

@ -1592,15 +1592,19 @@ class Event(models.Model):
else: else:
event_structure["modified_date"] = None event_structure["modified_date"] = None
if "start_time" in event_structure: if "start_time" in event_structure and event_structure["start_time"] != "":
event_structure["start_time"] = time.fromisoformat( event_structure["start_time"] = time.fromisoformat(
event_structure["start_time"] event_structure["start_time"]
) )
else:
event_structure["start_time"] = None
if "end_time" in event_structure: if "end_time" in event_structure and event_structure["end_time"] != "":
event_structure["end_time"] = time.fromisoformat( event_structure["end_time"] = time.fromisoformat(
event_structure["end_time"] event_structure["end_time"]
) )
else:
event_structure["end_time"] = None
if "location" not in event_structure or event_structure["location"] is None: if "location" not in event_structure or event_structure["location"] is None:
event_structure["location"] = "" event_structure["location"] = ""