Fix some more CC issues

This commit is contained in:
Karl Erik Õunapuu 2020-10-13 13:33:39 +03:00
parent cdf28befca
commit aac74e26f1
No known key found for this signature in database
GPG key ID: C9DD647298A34764
4 changed files with 17 additions and 17 deletions

View file

@ -27,12 +27,7 @@ module Actions
def validate_ident
validate_ident_integrity
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'))
@error = true
end
validate_ident_birthday
identifier = ::Contact::Ident.new(code: ident[:ident], type: ident[:ident_type],
country_code: ident[:ident_country_code])
@ -54,6 +49,15 @@ module Actions
end
end
def validate_ident_birthday
return if ident.blank?
return unless 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'))
@error = true
end
def maybe_attach_legal_doc
return unless legal_document