diff --git a/app/controllers/admin/certificates_controller.rb b/app/controllers/admin/certificates_controller.rb index a08654db3..636a69367 100644 --- a/app/controllers/admin/certificates_controller.rb +++ b/app/controllers/admin/certificates_controller.rb @@ -28,6 +28,10 @@ module Admin end def destroy + if @certificate.interface == Certificate::REGISTRAR + @certificate.revoke! + end + if @certificate.destroy flash[:notice] = I18n.t('record_deleted') redirect_to admin_api_user_path(@api_user) diff --git a/app/models/certificate.rb b/app/models/certificate.rb index cb28f629b..212114862 100644 --- a/app/models/certificate.rb +++ b/app/models/certificate.rb @@ -127,6 +127,7 @@ class Certificate < ActiveRecord::Base self.class.update_registry_crl self.class.reload_apache + self end class << self