🩹 round event end time to nearest minute

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.
This commit is contained in:
Marc Koch 2025-07-16 15:00:30 +02:00
parent 9bfb8c28f6
commit 66cb2f01f8
Signed by: marc
GPG Key ID: 12406554CFB028B9
1 changed files with 3 additions and 0 deletions

View File

@ -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: