Send unregistered domain to auction after dispute is closed

This commit is contained in:
Karl Erik Õunapuu 2020-05-08 15:48:48 +03:00
parent dc9bf7a5d3
commit 529a8a1bf6
2 changed files with 12 additions and 2 deletions

View file

@ -55,8 +55,16 @@ class Dispute < ApplicationRecord
return false unless update(closed: true) return false unless update(closed: true)
return if Dispute.active.where(domain_name: domain_name).any? return if Dispute.active.where(domain_name: domain_name).any?
whois_record = Whois::Record.find_or_initialize_by(name: domain_name) domain = DNS::DomainName.new(domain_name)
return true if remove_whois_data(whois_record) if domain.available? && domain.auctionable?
domain.sell_at_auction
return true
else
whois_record = Whois::Record.find_or_initialize_by(name: domain_name)
return true if remove_whois_data(whois_record)
end
false
end end
def remove_whois_data(record) def remove_whois_data(record)

View file

@ -29,6 +29,8 @@ module DNS
:at_auction :at_auction
elsif awaiting_payment? elsif awaiting_payment?
:awaiting_payment :awaiting_payment
elsif disputed?
:disputed
end end
end end