mirror of
https://github.com/internetee/registry.git
synced 2025-06-13 16:14:47 +02:00
Fix some CC issues
This commit is contained in:
parent
f6580bd79a
commit
eb19412643
3 changed files with 17 additions and 10 deletions
|
@ -24,7 +24,8 @@ module Epp
|
||||||
|
|
||||||
@contact = Epp::Contact.new(params[:parsed_frame], current_user.registrar)
|
@contact = Epp::Contact.new(params[:parsed_frame], current_user.registrar)
|
||||||
collected_data = ::Deserializers::Xml::ContactCreate.new(params[:parsed_frame])
|
collected_data = ::Deserializers::Xml::ContactCreate.new(params[:parsed_frame])
|
||||||
action = Actions::ContactCreate.new(@contact, collected_data.legal_document, collected_data.ident)
|
action = Actions::ContactCreate.new(@contact, collected_data.legal_document,
|
||||||
|
collected_data.ident)
|
||||||
|
|
||||||
if action.call
|
if action.call
|
||||||
if !address_processing? && address_given?
|
if !address_processing? && address_given?
|
||||||
|
|
|
@ -34,12 +34,11 @@ module Repp
|
||||||
|
|
||||||
if update
|
if update
|
||||||
@errors.each_with_index do |errors, index|
|
@errors.each_with_index do |errors, index|
|
||||||
if errors[:code] == '2304' &&
|
next unless errors[:code] == '2304' && errors[:value].present? &&
|
||||||
errors[:value].present? &&
|
errors[:value][:val] == DomainStatus::SERVER_DELETE_PROHIBITED &&
|
||||||
errors[:value][:val] == DomainStatus::SERVER_DELETE_PROHIBITED &&
|
errors[:value][:obj] == 'status'
|
||||||
errors[:value][:obj] == 'status'
|
|
||||||
@errors[index][:value][:val] = DomainStatus::PENDING_UPDATE
|
@errors[index][:value][:val] = DomainStatus::PENDING_UPDATE
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,7 +76,12 @@ module Repp
|
||||||
|
|
||||||
return if allowed
|
return if allowed
|
||||||
|
|
||||||
render(json: { errors: [{ base: [I18n.t('registrar.authorization.ip_not_allowed', ip: request.ip)] }] }, status: :unauthorized)
|
render(
|
||||||
|
status: :unauthorized,
|
||||||
|
json: { errors: [
|
||||||
|
{ base: [I18n.t('registrar.authorization.ip_not_allowed', ip: request.ip)] },
|
||||||
|
] }
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def not_found_error
|
def not_found_error
|
||||||
|
|
|
@ -28,7 +28,8 @@ module Actions
|
||||||
def validate_ident
|
def validate_ident
|
||||||
if ident.present?
|
if ident.present?
|
||||||
if ident[:ident_type].blank?
|
if ident[:ident_type].blank?
|
||||||
contact.add_epp_error('2003', nil, 'ident_type', I18n.t('errors.messages.required_ident_attribute_missing'))
|
contact.add_epp_error('2003', nil, 'ident_type',
|
||||||
|
I18n.t('errors.messages.required_ident_attribute_missing'))
|
||||||
@error = true
|
@error = true
|
||||||
elsif !%w[priv org birthday].include?(ident[:ident_type])
|
elsif !%w[priv org birthday].include?(ident[:ident_type])
|
||||||
contact.add_epp_error('2003', nil, 'ident_type', 'Invalid ident type')
|
contact.add_epp_error('2003', nil, 'ident_type', 'Invalid ident type')
|
||||||
|
@ -37,7 +38,8 @@ module Actions
|
||||||
end
|
end
|
||||||
|
|
||||||
if ident.present? && ident[:ident_type] != 'birthday' && ident[:ident_country_code].blank?
|
if ident.present? && ident[:ident_type] != 'birthday' && ident[:ident_country_code].blank?
|
||||||
contact.add_epp_error('2003', nil, 'ident_country_code', I18n.t('errors.messages.required_ident_attribute_missing'))
|
contact.add_epp_error('2003', nil, 'ident_country_code',
|
||||||
|
I18n.t('errors.messages.required_ident_attribute_missing'))
|
||||||
@error = true
|
@error = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue