mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 06:56:23 +02:00
remove validation from contact creation
This commit is contained in:
parent
66f3fca97a
commit
1ce5ebd629
1 changed files with 4 additions and 8 deletions
|
@ -1,11 +1,12 @@
|
||||||
module Actions
|
module Actions
|
||||||
class ContactCreate
|
class ContactCreate
|
||||||
attr_reader :contact, :legal_document, :ident
|
attr_reader :contact, :legal_document, :ident, :result
|
||||||
|
|
||||||
def initialize(contact, legal_document, ident)
|
def initialize(contact, legal_document, ident)
|
||||||
@contact = contact
|
@contact = contact
|
||||||
@legal_document = legal_document
|
@legal_document = legal_document
|
||||||
@ident = ident
|
@ident = ident
|
||||||
|
@result = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def call
|
def call
|
||||||
|
@ -20,13 +21,8 @@ module Actions
|
||||||
return if Rails.env.test?
|
return if Rails.env.test?
|
||||||
|
|
||||||
%i[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)
|
||||||
if result
|
next if @result
|
||||||
@contact.validate_email_by_regex_and_mx(single_email: true)
|
|
||||||
@contact.remove_force_delete_for_valid_contact
|
|
||||||
|
|
||||||
next
|
|
||||||
end
|
|
||||||
|
|
||||||
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, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
contact.add_epp_error('2005', nil, nil, "#{I18n.t(:parameter_value_syntax_error)} #{err_text}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue