Ident attribute missing error message show cc or type #2677

This commit is contained in:
Priit Tark 2015-07-20 15:32:33 +03:00
parent eabbc2045c
commit 4b1bf92a27
3 changed files with 49 additions and 2 deletions

View file

@ -94,12 +94,26 @@ class Epp::ContactsController < EppController
'postalInfo > addr > pc', 'postalInfo > addr > cc', 'voice', 'email'
)
ident = params[:parsed_frame].css('ident')
if ident.present? && ident.attr('type').blank?
epp_errors << {
code: '2003',
msg: I18n.t('errors.messages.required_ident_attribute_missing', key: 'type')
}
end
if ident.present? && ident.text != 'birthday' && ident.attr('cc').blank?
epp_errors << {
code: '2003',
msg: I18n.t('errors.messages.required_attribute_missing', key: 'ident country code missing')
msg: I18n.t('errors.messages.required_ident_attribute_missing', key: 'cc')
}
end
# if ident.present? && ident.attr('cc').blank?
# epp_errors << {
# code: '2003',
# msg: I18n.t('errors.messages.required_ident_attribute_missing', key: 'cc')
# }
# end
contact_org_disabled
fax_disabled
status_editing_disabled