🩹 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:
parent
9bfb8c28f6
commit
66cb2f01f8
|
|
@ -176,6 +176,9 @@ class Event(models.Model):
|
||||||
self.created = datetime.now(tz=timezone.get_current_timezone())
|
self.created = datetime.now(tz=timezone.get_current_timezone())
|
||||||
self.ics = self.create_ics()
|
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
|
# Send the event to the CalDAV server if it has not been cancelled yet
|
||||||
if not self.cancelled:
|
if not self.cancelled:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue