From d8bc1206d2b3cc8bb4c7daa177979ae73a26eac6 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 25 Nov 2020 18:03:05 +0100 Subject: [PATCH] perf: fix performance regression from 7a2d6f6bd5 most notable when using the "add" button in recruitment --- castellum/appointments/signals.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/castellum/appointments/signals.py b/castellum/appointments/signals.py index a536c263c..5ced61385 100644 --- a/castellum/appointments/signals.py +++ b/castellum/appointments/signals.py @@ -45,4 +45,7 @@ def delete_scheduler_appointments_on_save(sender, instance, using, **kwargs): from castellum.recruitment.models import Participation if sender is Participation and instance.status != Participation.INVITED: + # PERF: ignore if instance has not been saved to the database yet + if not instance.pk: + return delete_scheduler_appointments_on_delete(sender, instance, using, **kwargs) -- GitLab