mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
added validation checker before create
This commit is contained in:
parent
38e823b0dd
commit
8dd7cd4b9c
1 changed files with 17 additions and 0 deletions
|
@ -12,9 +12,26 @@ module Actions
|
|||
maybe_remove_address
|
||||
maybe_attach_legal_doc
|
||||
validate_ident
|
||||
maybe_change_email
|
||||
commit
|
||||
end
|
||||
|
||||
def maybe_change_email
|
||||
return if Rails.env.test?
|
||||
|
||||
[:regex, :mx].each do |m|
|
||||
r = Actions::SimpleMailValidator.run(email: contact.email, level: m)
|
||||
|
||||
unless r.success
|
||||
contact.add_epp_error('2005', nil, r.errors, I18n.t(:parameter_value_syntax_error))
|
||||
@error = true
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
def maybe_remove_address
|
||||
return if Contact.address_processing?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue