mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
Fix some code styling issues
This commit is contained in:
parent
42946dfa15
commit
25d78cde74
4 changed files with 23 additions and 15 deletions
|
@ -3,7 +3,7 @@
|
||||||
module Admin
|
module Admin
|
||||||
class DisputesController < BaseController
|
class DisputesController < BaseController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
before_action :set_dispute, only: %i[show edit update destroy]
|
before_action :set_dispute, only: %i[show edit update delete]
|
||||||
|
|
||||||
# GET /admin/disputes
|
# GET /admin/disputes
|
||||||
def index
|
def index
|
||||||
|
@ -12,12 +12,16 @@ module Admin
|
||||||
|
|
||||||
@q = disputes.search(params[:q])
|
@q = disputes.search(params[:q])
|
||||||
@disputes = @q.result.page(params[:page])
|
@disputes = @q.result.page(params[:page])
|
||||||
@disputes = @disputes.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
if params[:results_per_page].to_i.positive?
|
||||||
|
@disputes = @disputes.per(params[:results_per_page])
|
||||||
|
end
|
||||||
|
|
||||||
closed_disputes = Dispute.closed.order(:domain_name)
|
closed_disputes = Dispute.closed.order(:domain_name)
|
||||||
@closed_q = closed_disputes.search(params[:closed_q])
|
@closed_q = closed_disputes.search(params[:closed_q])
|
||||||
@closed_disputes = @closed_q.result.page(params[:closed_page])
|
@closed_disputes = @closed_q.result.page(params[:closed_page])
|
||||||
@closed_disputes = @closed_disputes.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
return unless params[:results_per_page].to_i.positive?
|
||||||
|
|
||||||
|
@closed_disputes = @closed_disputes.per(params[:results_per_page])
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /admin/disputes/1
|
# GET /admin/disputes/1
|
||||||
|
|
|
@ -32,7 +32,6 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController
|
||||||
elsif params[:confirmed]
|
elsif params[:confirmed]
|
||||||
if @registrant_verification.domain_registrant_change_confirm!("email link, #{initiator}")
|
if @registrant_verification.domain_registrant_change_confirm!("email link, #{initiator}")
|
||||||
if @domain.disputed?
|
if @domain.disputed?
|
||||||
Rails.logger.info 'Closing domain dispute via RegistrantConfirmation'
|
|
||||||
dispute = Dispute.active.find_by(domain_name: @domain.name)
|
dispute = Dispute.active.find_by(domain_name: @domain.name)
|
||||||
dispute.close
|
dispute.close
|
||||||
end
|
end
|
||||||
|
|
|
@ -90,7 +90,8 @@ class Dispute < ApplicationRecord
|
||||||
def validate_domain_name_period_uniqueness
|
def validate_domain_name_period_uniqueness
|
||||||
return unless new_record?
|
return unless new_record?
|
||||||
|
|
||||||
existing_dispute = Dispute.unscoped.where(domain_name: domain_name, closed: false).where('expires_at > ?', starts_at)
|
existing_dispute = Dispute.unscoped.where(domain_name: domain_name, closed: false)
|
||||||
|
.where('expires_at > ?', starts_at)
|
||||||
return unless existing_dispute.any?
|
return unless existing_dispute.any?
|
||||||
|
|
||||||
errors.add(:base, 'Dispute already exists for this domain at given timeframe')
|
errors.add(:base, 'Dispute already exists for this domain at given timeframe')
|
||||||
|
|
|
@ -53,13 +53,13 @@ class Epp::Domain < Domain
|
||||||
def epp_code_map
|
def epp_code_map
|
||||||
{
|
{
|
||||||
'2002' => [ # Command use error
|
'2002' => [ # Command use error
|
||||||
[:base, :domain_already_belongs_to_the_querying_registrar]
|
%i[base domain_already_belongs_to_the_querying_registrar]
|
||||||
],
|
],
|
||||||
'2003' => [ # Required parameter missing
|
'2003' => [ # Required parameter missing
|
||||||
[:registrant, :blank],
|
%i[registrant blank],
|
||||||
[:registrar, :blank],
|
%i[registrar blank],
|
||||||
[:base, :required_parameter_missing_reserved],
|
%i[base required_parameter_missing_reserved],
|
||||||
[:base, :required_parameter_missing_disputed]
|
%i[base required_parameter_missing_disputed],
|
||||||
],
|
],
|
||||||
'2004' => [ # Parameter value range error
|
'2004' => [ # Parameter value range error
|
||||||
[:dnskeys, :out_of_range,
|
[:dnskeys, :out_of_range,
|
||||||
|
@ -86,11 +86,11 @@ class Epp::Domain < Domain
|
||||||
[:puny_label, :too_long, { obj: 'name', val: name_puny }]
|
[:puny_label, :too_long, { obj: 'name', val: name_puny }]
|
||||||
],
|
],
|
||||||
'2201' => [ # Authorisation error
|
'2201' => [ # Authorisation error
|
||||||
[:transfer_code, :wrong_pw]
|
%i[transfer_code wrong_pw]
|
||||||
],
|
],
|
||||||
'2202' => [
|
'2202' => [
|
||||||
[:base, :invalid_auth_information_reserved],
|
%i[base invalid_auth_information_reserved],
|
||||||
[:base, :invalid_auth_information_disputed]
|
%i[base invalid_auth_information_disputed],
|
||||||
],
|
],
|
||||||
'2302' => [ # Object exists
|
'2302' => [ # Object exists
|
||||||
[:name_dirty, :taken, { value: { obj: 'name', val: name_dirty } }],
|
[:name_dirty, :taken, { value: { obj: 'name', val: name_dirty } }],
|
||||||
|
@ -481,10 +481,14 @@ class Epp::Domain < Domain
|
||||||
if !same_registrant_as_current && disputed?
|
if !same_registrant_as_current && disputed?
|
||||||
disputed_pw = frame.css('disputed > pw').text
|
disputed_pw = frame.css('disputed > pw').text
|
||||||
if disputed_pw.blank?
|
if disputed_pw.blank?
|
||||||
add_epp_error('2304', nil, nil, 'Required parameter missing; disputed pw element required for dispute domains')
|
add_epp_error('2304', nil, nil, 'Required parameter missing; disputed' \
|
||||||
|
'pw element required for dispute domains')
|
||||||
else
|
else
|
||||||
dispute = Dispute.active.find_by(domain_name: name, password: disputed_pw)
|
dispute = Dispute.active.find_by(domain_name: name, password: disputed_pw)
|
||||||
add_epp_error('2202', nil, nil, 'Invalid authorization information; invalid disputed>pw value') if dispute.nil?
|
if dispute.nil?
|
||||||
|
add_epp_error('2202', nil, nil, 'Invalid authorization information; '\
|
||||||
|
'invalid disputed>pw value')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue