From 66cb2f01f8707ea8dcce7c718bba0d4d045774c5 Mon Sep 17 00:00:00 2001 From: Marc Koch Date: Wed, 16 Jul 2025 15:00:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20round=20event=20end=20time=20to?= =?UTF-8?q?=20nearest=20minute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensures that the event end time is rounded down to the nearest minute. This prevents potential collision issues where events start and end at very close times (seconds/milliseconds), especially when creating new events. --- src/booking.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/booking.py b/src/booking.py index f7daedc..6cd2b89 100644 --- a/src/booking.py +++ b/src/booking.py @@ -176,6 +176,9 @@ class Event(models.Model): self.created = datetime.now(tz=timezone.get_current_timezone()) self.ics = self.create_ics() + # Round down to the nearest minute to avoid collisions between events + self.end = self.end.replace(second=0, microsecond=0) + # Send the event to the CalDAV server if it has not been cancelled yet if not self.cancelled: try: