fixed a null create bug due to write not checking if id is set

This commit is contained in:
Marc Durepos 2024-05-23 17:03:09 -04:00
parent d6c946dcd0
commit 0c78f7314f

View file

@ -27,7 +27,7 @@ class CalendarEvent(models.Model):
def write(self, vals):
res = super(CalendarEvent, self).write(vals)
if not self.env.context.get('caldav_no_sync'):
if not self.env.context.get('caldav_no_sync') and self.id:
try:
_logger.debug(f"Updating event {self.name} in CalDAV")
self.sync_update_to_caldav()