mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 22:16:19 +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
|
||||
class ContactCreate
|
||||
attr_reader :contact, :legal_document, :ident
|
||||
attr_reader :contact, :legal_document, :ident, :result
|
||||
|
||||
def initialize(contact, legal_document, ident)
|
||||
@contact = contact
|
||||
@legal_document = legal_document
|
||||
@ident = ident
|
||||
@result = nil
|
||||
end
|
||||
|
||||
def call
|
||||
|
@ -20,13 +21,8 @@ module Actions
|
|||
return if Rails.env.test?
|
||||
|
||||
%i[regex mx].each do |m|
|
||||
result = Actions::SimpleMailValidator.run(email: contact.email, level: m)
|
||||
if result
|
||||
@contact.validate_email_by_regex_and_mx(single_email: true)
|
||||
@contact.remove_force_delete_for_valid_contact
|
||||
|
||||
next
|
||||
end
|
||||
@result = Actions::SimpleMailValidator.run(email: contact.email, level: m)
|
||||
next if @result
|
||||
|
||||
err_text = "email '#{contact.email}' didn't pass validation"
|
||||
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