Commit 6d47ebcf authored by Thijs de Jong's avatar Thijs de Jong
Browse files

Merge branch 'fix/pizzas-event-saving' into 'master'

Fix saving pizza event if notification already exists

See merge request !1252
parents 786360f9 e751fdfb
...@@ -114,7 +114,10 @@ class PizzaEvent(models.Model): ...@@ -114,7 +114,10 @@ class PizzaEvent(models.Model):
self.end_reminder.time = self.end self.end_reminder.time = self.end
self.end_reminder.save() self.end_reminder.save()
elif not self.send_notification and self.end_reminder: elif not self.send_notification and self.end_reminder:
self.end_reminder.delete() end_reminder = self.end_reminder
self.end_reminder = None
if not self.end_reminder.sent:
end_reminder.delete()
super().save(*args, **kwargs) super().save(*args, **kwargs)
......
Markdown is supported
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