modified: README.md
modified: netbox_dns_bridge/notify_handler.py modified: netbox_dns_bridge/request_handler.py modified: netbox_dns_bridge/signals/netbox_dns_zones.py Disable NOTIFY feature by default and add setting to enable it.
This commit is contained in:
1 parent
cb4886f032
commit
73544a4335
4 files changed
+70
-53
No files matched your search
@@ -1,11 +1,14 @@
|
||||
from django.db.models.signals import pre_save, post_save
|
||||
from django.dispatch import receiver
|
||||
from django.db import transaction
|
||||
from django.conf import settings
|
||||
from netbox.context import current_request
|
||||
from netbox_dns.models import Zone
|
||||
from netbox_dns_bridge import catalog_zone_manager as catzm
|
||||
from netbox_dns_bridge import notify_handler
|
||||
|
||||
SETTINGS = settings.PLUGINS_CONFIG["netbox_dns_bridge"]
|
||||
|
||||
|
||||
@receiver(pre_save, sender=Zone)
|
||||
def zone_pre_save(sender, instance, **kwargs):
|
||||
@@ -31,7 +34,9 @@ def zone_post_save(sender, instance, created, **kwargs):
|
||||
|
||||
def _on_commit():
|
||||
catzm.increment_soa_serial()
|
||||
notify_handler.schedule(zone)
|
||||
|
||||
if SETTINGS.get("notify_clients", False):
|
||||
notify_handler.schedule(zone)
|
||||
|
||||
transaction.on_commit(_on_commit)
|
||||
|
||||
|
||||
Reference in new issue
Block a user