From e6cb30b599650ebc8aef55b065bf6f6acc614fa6 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Thu, 20 Mar 2025 16:39:20 +0200 Subject: [PATCH] added check --- app/models/epp/domain.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 0593e1652..20a00561a 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -37,7 +37,12 @@ class Epp::Domain < Domain # validate registrant here as well ([Contact.find(registrant.id)] + active_admins + active_techs).each do |x| unless x.valid? - add_epp_error('2304', nil, nil, I18n.t(:contact_is_not_valid, value: x.try(:code))) + if x.underage? + add_epp_error('2304', nil, nil, I18n.t('activerecord.errors.models.domain.contact_too_young')) + else + add_epp_error('2304', nil, nil, I18n.t(:contact_is_not_valid, value: x.try(:code))) + end + ok = false end end