From 8fd1d703ac691df36f468352fa982c74daaf0290 Mon Sep 17 00:00:00 2001 From: Peter Eckel Date: Tue, 26 Nov 2024 15:57:43 +0100 Subject: [PATCH] Check whether dns_name set before running post_clean on IP addresses --- netbox_dns/signals/ipam_dnssync.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netbox_dns/signals/ipam_dnssync.py b/netbox_dns/signals/ipam_dnssync.py index 4ea3fbce..d02bcae8 100644 --- a/netbox_dns/signals/ipam_dnssync.py +++ b/netbox_dns/signals/ipam_dnssync.py @@ -35,6 +35,9 @@ @receiver(post_clean, sender=IPAddress) def ipam_dnssync_ipaddress_post_clean(instance, **kwargs): + if not instance.dns_name: + return + if not isinstance(instance.address, IPNetwork): return