Skip to content

Commit

Permalink
fix: improve admin contact validation messages
Browse files Browse the repository at this point in the history
- Update error message for missing admin contact to be more concise
- Standardize admin contact validation message for invalid ident type
- Remove redundant error message formatting

The changes make admin contact validation messages more consistent
throughout the application, using "Admin contact" terminology instead
of "Administrative contact" for better clarity and consistency.
  • Loading branch information
OlegPhenomenon committed Feb 5, 2025
1 parent a56237c commit 2d103bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/models/epp/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ def validate_contacts
active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? }
active_techs = tech_domain_contacts.select { |x| !x.marked_for_destruction? }

# Проверка количества админ контактов
if require_admin_contacts? && active_admins.empty?
add_epp_error('2306', 'contact', nil, 'Admin contacts are required')
add_epp_error('2306', 'contact', nil, 'Admin contact is required')
ok = false
end

Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ en:

domain:
<<: *epp_domain_ar_attributes
admin_contact_invalid_ident_type: "Administrative contact with identification type '%{ident_type}' is not allowed"
admin_contact_invalid_ident_type: "Admin contact can be private person only"

nameserver:
attributes:
Expand Down

0 comments on commit 2d103bd

Please sign in to comment.