diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fc6ab5..3887554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## Unreleased +- Defer the catalog zone SOA serial increment on zone deletion to `transaction.on_commit`, matching + the create/modify path. Previously the increment ran immediately at `post_delete` time, so a + rollback of the delete transaction would have left the catalog serial bumped anyway. - Add the option to send a NOTIFY directly to a zone's own nameservers when its SOA serial number changes. Enable it per zone via a boolean custom field named by `notify_ns_custom_field_name`, globally for all zones via `notify_ns_all_zones` (default `False`), or both. Nameserver addresses diff --git a/netbox_dns_bridge/signals/netbox_dns_zones.py b/netbox_dns_bridge/signals/netbox_dns_zones.py index bf8b1c2..fcb1747 100644 --- a/netbox_dns_bridge/signals/netbox_dns_zones.py +++ b/netbox_dns_bridge/signals/netbox_dns_zones.py @@ -72,7 +72,10 @@ def zone_post_save(sender, instance, created, **kwargs): @receiver(post_delete, sender=Zone) def zone_post_delete(sender, instance, **kwargs): - catzm.increment_soa_serial() + def _on_commit(): + catzm.increment_soa_serial() + + transaction.on_commit(_on_commit) def _notify_ns_enabled(zone) -> bool: