mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Add logging & domain lock on release
This commit is contained in:
parent
d35042a1be
commit
0c5ef72c7d
5 changed files with 30 additions and 3 deletions
|
@ -1,24 +1,30 @@
|
|||
module Whois
|
||||
class Record < Whois::Server
|
||||
include ToStdout
|
||||
self.table_name = 'whois_records'
|
||||
|
||||
def self.disclaimer
|
||||
Setting.registry_whois_disclaimer
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def update_from_auction(auction)
|
||||
if auction.started?
|
||||
update!(json: { name: auction.domain,
|
||||
status: ['AtAuction'],
|
||||
disclaimer: self.class.disclaimer })
|
||||
to_stdout "Updated from auction WHOIS record #{inspect}"
|
||||
elsif auction.no_bids?
|
||||
to_stdout "Destroying WHOIS record #{inspect}"
|
||||
destroy!
|
||||
elsif auction.awaiting_payment? || auction.payment_received?
|
||||
update!(json: { name: auction.domain,
|
||||
status: ['PendingRegistration'],
|
||||
disclaimer: self.class.disclaimer,
|
||||
registration_deadline: auction.whois_deadline })
|
||||
to_stdout "Updated from auction WHOIS record #{inspect}"
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue