Commits

George Notaras committed 28adb5a

The ``zone_saved`` signal accepts a ``powerdns_manager.Domain`` instance as argument instead of the origin.

Comments (0)

Files changed (2)

src/powerdns_manager/admin.py

         """
         super(DomainAdmin, self).save_related(request, form, formsets, change)
         # Send the zone_saved signal
-        zone_saved.send(sender=self.model, origin=form.cleaned_data.get('name'))
+        zone_saved.send(sender=self.model, instance=form.instance)
 
 admin.site.register(cache.get_model('powerdns_manager', 'Domain'), DomainAdmin)
 

src/powerdns_manager/signal_cb.py

 # ``zone_saved`` signal.
 # Sent by admin.DomainAdmin.save_related() after the Domain instance and all
 # the associated Record instances have been saved.
-zone_saved = django.dispatch.Signal(providing_args=['origin'])
+zone_saved = django.dispatch.Signal(providing_args=['instance'])
 
 
 def rectify_zone_cb(sender, **kwargs):
-    rectify_zone(kwargs['origin'])
+    instance = kwargs['instance']   # powerdns_manager.Domain instance
+    rectify_zone(instance.name)