Skip to content
Snippets Groups Projects
Commit 127ff64e authored by jan.bednarik's avatar jan.bednarik
Browse files

Fix calendars overwriting

parent 6b89ce20
No related branches found
No related tags found
2 merge requests!816Release,!815Fix calendars overwriting
Pipeline #14462 passed
......@@ -130,11 +130,7 @@ class CalendarMixin(models.Model):
def save(self, *args, **kwargs):
# create or update related Calendar
if self.calendar_url:
if self.calendar:
if self.calendar.url != self.calendar_url:
self.calendar.url = self.calendar_url
self.calendar.save()
else:
if not self.calendar or self.calendar.url != self.calendar_url:
calendar = Calendar.objects.filter(url=self.calendar_url).first()
if calendar:
self.calendar = calendar
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment