mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Send unregistered domain to auction after dispute is closed
This commit is contained in:
parent
dc9bf7a5d3
commit
529a8a1bf6
2 changed files with 12 additions and 2 deletions
|
@ -55,10 +55,18 @@ 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?
|
||||||
|
|
||||||
|
domain = DNS::DomainName.new(domain_name)
|
||||||
|
if domain.available? && domain.auctionable?
|
||||||
|
domain.sell_at_auction
|
||||||
|
return true
|
||||||
|
else
|
||||||
whois_record = Whois::Record.find_or_initialize_by(name: domain_name)
|
whois_record = Whois::Record.find_or_initialize_by(name: domain_name)
|
||||||
return true if remove_whois_data(whois_record)
|
return true if remove_whois_data(whois_record)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
def remove_whois_data(record)
|
def remove_whois_data(record)
|
||||||
record.json['status'] = record.json['status'].delete_if { |status| status == 'disputed' }
|
record.json['status'] = record.json['status'].delete_if { |status| status == 'disputed' }
|
||||||
if record.json['status'].blank?
|
if record.json['status'].blank?
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue