Commits

George Notaras  committed a6f0078

Zone serial is updated by PowerDNS Manager instead of letting it be auto-updated by PowerDNS.

  • Participants
  • Parent commits 0b0ab69

Comments (0)

Files changed (3)

File src/powerdns_manager/actions.py

         if n and domain_type:
             for obj in queryset:
                 obj.type = domain_type
+                obj.update_serial()
                 obj.save()
                 obj_display = force_unicode(obj)
                 modeladmin.log_change(request, obj, obj_display)
                         rr.save()
                         rr_display = force_unicode(rr)
                         modeladmin.log_change(request, rr, rr_display)
+                    
+                    # Update the domain serial
+                    domain_obj.update_serial()
+                    
                     record_count += len(qs)
                 messages.info(request, 'Successfully updated %d zones (%d total records).' % (n, record_count))
             # Return None to display the change list page again.

File src/powerdns_manager/admin.py

         if not change:
             obj.created_by = request.user
         obj.save()
+        # TODO: Find a way to update the zone serial (SOA record)
+        # At this point, the records have not been saved yet.
+        # Perhaps with a signal in save_related()
     
     def save_related(self, request, form, formsets, change):
         """Calls the signal that rectifies the zone.

File src/powerdns_manager/utils.py

                     
                     rr.save()
         
+        # Update zone serial
+        the_domain.update_serial()
+        
         # Rectify zone
         rectify_zone(the_domain.name)