From e8762bf8079f5461b1a43df4855f65138146d0cf Mon Sep 17 00:00:00 2001 From: Sven Luethi Date: Wed, 12 Aug 2026 01:21:11 +0200 Subject: [PATCH] modified: CHANGELOG.md modified: netbox_dns_bridge/signals/netbox_dns_zones.py Defer catalog zone SOA serial increment to transaction.on_commit on zone deletion, matching the create/modify path and making delete rollback-safe --- CHANGELOG.md | 3 +++ netbox_dns_bridge/signals/netbox_dns_zones.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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: