mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +02:00
Merge pull request #2403 from internetee/exceptions-for-registered-domains-and-no-bids-auctions
added exception for auctions with no-bids and registred-domains statuses
This commit is contained in:
commit
4a31cc3b15
3 changed files with 65 additions and 9 deletions
|
@ -31,7 +31,7 @@ module Admin
|
|||
def create
|
||||
auction = Auction.new(domain: params[:domain], status: Auction.statuses[:started], platform: 'manual')
|
||||
|
||||
if domain_exists_in_blocked_disputed_and_registered?(params[:domain])
|
||||
if Auction.domain_exists_in_blocked_disputed_and_registered?(params[:domain])
|
||||
flash[:alert] = "Adding #{params[:domain]} failed - domain registered or regsitration is blocked"
|
||||
redirect_to admin_auctions_path and return
|
||||
end
|
||||
|
@ -81,7 +81,7 @@ module Admin
|
|||
table.each do |row|
|
||||
record = row.to_h
|
||||
|
||||
if domain_exists_in_blocked_disputed_and_registered?(record['name'])
|
||||
if Auction.domain_exists_in_blocked_disputed_and_registered?(record['name'])
|
||||
failed_names << record['name']
|
||||
|
||||
next
|
||||
|
@ -119,13 +119,6 @@ module Admin
|
|||
Epp::Domain.check_availability(domain_name)
|
||||
end
|
||||
|
||||
def domain_exists_in_blocked_disputed_and_registered?(domain_name)
|
||||
Domain.exists?(name: domain_name) ||
|
||||
BlockedDomain.exists?(name: domain_name) ||
|
||||
Dispute.exists?(domain_name: domain_name) ||
|
||||
Auction.exists?(domain: domain_name)
|
||||
end
|
||||
|
||||
def validate_table(table)
|
||||
first_row = table.headers
|
||||
first_row.include? 'name'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue