Commits

George Notaras committed bde8304

Cleaned-up cloning action.

  • Participants
  • Parent commits 3343eb2

Comments (0)

Files changed (1)

File src/powerdns_manager/actions.py

         form = ClonedZoneDomainForm(request.POST)
         if form.is_valid():
             
+            # Store the new domain name for the clone.
             clone_domain_name = form.cleaned_data['clone_domain_name']
             
             if not clone_domain_name:
                 # Construct RR name with interchanged domain
                 clone_rr_name = interchange_domain(rr.name, domain_obj.name, clone_domain_name)
                 
-                # Special treatment to the content of SOA and SRV
+                # Special treatment to the content of SOA and SRV RRs
                 if rr.type == 'SOA':
                     content_parts = rr.content.split()
                     # primary
                 else:
                     clone_rr_content = interchange_domain(rr.content, domain_obj.name, clone_domain_name)
                 
+                # Create and save the cloned record.
                 clone_rr = Record(
                     domain = clone_obj,
                     name = clone_rr_name,
                 clone_rr.save()
                 modeladmin.log_addition(request, clone_rr)
             
-            # Update the domain serial
-            #domain_obj.update_serial()
-            
             messages.info(request, 'Successfully cloned %s zone to %s' % \
                 (domain_obj.name, clone_domain_name))