mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 15:34:41 +02:00
Fixed codeclimate errors
This commit is contained in:
parent
ecb23b4119
commit
bcd1b3f745
3 changed files with 4 additions and 8 deletions
|
@ -19,14 +19,12 @@ module Actions
|
||||||
def maybe_change_email
|
def maybe_change_email
|
||||||
return if Rails.env.test?
|
return if Rails.env.test?
|
||||||
|
|
||||||
[:regex, :mx].each do |m|
|
%i[regex mx].each do |m|
|
||||||
result = Actions::SimpleMailValidator.run(email: contact.email, level: m)
|
result = Actions::SimpleMailValidator.run(email: contact.email, level: m)
|
||||||
|
|
||||||
next if result
|
next if result
|
||||||
|
|
||||||
err_text = "email '#{contact.email}' didn't pass validation"
|
err_text = "email '#{contact.email}' didn't pass validation"
|
||||||
contact.add_epp_error('2005', nil, nil,
|
contact.add_epp_error('2005', nil, nil, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
||||||
"#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
|
||||||
@error = true
|
@error = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,8 +28,7 @@ module Actions
|
||||||
next if result
|
next if result
|
||||||
|
|
||||||
err_text = "email '#{new_attributes[:email]}' didn't pass validation"
|
err_text = "email '#{new_attributes[:email]}' didn't pass validation"
|
||||||
contact.add_epp_error('2005', nil, nil,
|
contact.add_epp_error('2005', nil, nil, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
||||||
"#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
|
||||||
@error = true
|
@error = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -141,8 +141,7 @@ module Actions
|
||||||
next if result
|
next if result
|
||||||
|
|
||||||
err_text = "email #{email} didn't pass validation"
|
err_text = "email #{email} didn't pass validation"
|
||||||
domain.add_epp_error('2005', nil, nil,
|
domain.add_epp_error('2005', nil, nil, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
||||||
"#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
|
||||||
@error = true
|
@error = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue