Allow punycode domains in bulk ns change domain scope

This commit is contained in:
Karl Erik Õunapuu 2020-12-30 11:09:46 +02:00
parent 0e120d4992
commit 8bb0fd80d1
No known key found for this signature in database
GPG key ID: C9DD647298A34764
3 changed files with 10 additions and 7 deletions

View file

@ -148,10 +148,12 @@ class Registrar < ApplicationRecord
failed_list = []
nameservers.where(hostname: hostname).find_each do |origin|
next unless domains.include?(origin.domain.name) || domains.empty?
idn = origin.domain.name
puny = origin.domain.name_puny
next unless domains.include?(idn) || domains.include?(puny) || domains.empty?
if origin.domain.nameservers.where(hostname: new_attributes[:hostname]).any?
failed_list << origin.domain.name
failed_list << idn
next
end
@ -160,7 +162,7 @@ class Registrar < ApplicationRecord
new_nameserver.attributes = new_attributes
new_nameserver.save!
domain_list << origin.domain.name
domain_list << idn
origin.destroy!
end