Commits

George Notaras  committed e7af187

Improved action that resets the API key of dynamic domains.

  • Participants
  • Parent commits 15921b0

Comments (0)

Files changed (3)

File src/powerdns_manager/actions.py

                 messages.error(request, 'Zone is not dynamic: %s' % domain_obj.name)
                 n = n - 1
     if n:
-        messages.info(request, 'Successfully updated %d domains.' % n)
+        messages.info(request, 'Successfully reset the API key of %d domains.' % n)
 reset_api_key.short_description = "Reset API Key"
 
 

File src/powerdns_manager/admin.py

             return HttpResponseRedirect(reverse('zone_clone', args=(obj.id,)))
         elif "_set_rr_ttl" in request.POST:
             return HttpResponseRedirect(reverse('zone_set_ttl', args=(obj.id,)))
+        elif "_reset_api_key" in request.POST:
+            Domain = cache.get_model('powerdns_manager', 'Domain')
+            qs = Domain.objects.filter(id=obj.id)
+            reset_api_key(self, request, qs)
 
         return super(DomainAdmin, self).response_change(request, obj)
 

File src/powerdns_manager/templates/powerdns_manager/domain_changeform.html

             <input type="submit" value="{% trans 'Clone zone' %}" name="_clone" />
             <input type="submit" value="{% trans 'Set RR TTL' %}" name="_set_rr_ttl" />
             <input type="submit" value="{% trans 'Reset API Key' %}" name="_reset_api_key" />
-            <input type="submit" value="{% trans 'Save as template' %}" name="_save_as_template" />
         </div>
         {% submit_row %}
     {% endblock %}