From ef33bc67c18bec136ec01634fe80b4054272e169 Mon Sep 17 00:00:00 2001 From: chapeau Date: Tue, 9 Jun 2020 18:49:55 +0200 Subject: [PATCH] Optimisation of domains update --- machines/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/machines/models.py b/machines/models.py index cdddf98c..0eb7e49d 100644 --- a/machines/models.py +++ b/machines/models.py @@ -2482,8 +2482,7 @@ def machinetype_post_save(**kwargs): parent IP type). """ machinetype = kwargs["instance"] - for interface in machinetype.all_interfaces(): - interface.update_type() + Domain.objects.filter(interface_parent__machine_type=machinetype).update(extension=machinetype.ip_type.extension) @receiver(post_save, sender=Domain)