From 582689195c0819b89ee55a36baa45292b9b66b62 Mon Sep 17 00:00:00 2001 From: Job Doesburg Date: Tue, 2 Apr 2024 09:03:37 +0200 Subject: [PATCH] Fix bug 2 --- website/venues/signals.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/venues/signals.py b/website/venues/signals.py index f8052bd7..3f82e36d 100644 --- a/website/venues/signals.py +++ b/website/venues/signals.py @@ -12,7 +12,11 @@ def send_reservation_status_change_email_receiver(sender, instance, **kwargs): if instance.pk is None or instance.user_created is None: return - old_instance = Reservation.objects.get(pk=instance.pk) + try: + old_instance = Reservation.objects.get(pk=instance.pk) + except Reservation.DoesNotExist: + return + if old_instance.accepted != instance.accepted: send_reservation_status_change_email(instance)