Verified Commit 8726f8d6 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Save event first before creating notifications when adding

parent 394ac9c8
......@@ -295,6 +295,9 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
return reverse('events:event', args=[str(self.pk)])
def save(self, *args, **kwargs):
if not self.pk:
super().save(*args, **kwargs)
if self.published:
if self.registration_required:
registration_reminder_time = (self.registration_start -
......@@ -361,7 +364,7 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
and not self.start_reminder.sent):
self.start_reminder.delete()
super().save(*args, **kwargs)
super().save()
def __str__(self):
return '{}: {}'.format(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment