mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
Story#109623634 - contacts ident data can be changed if ident_cc is not set or birthday is in wrong format
This commit is contained in:
parent
9d6fc7140d
commit
58bc4cc13b
1 changed files with 7 additions and 13 deletions
|
@ -160,20 +160,14 @@ class Epp::Contact < Contact
|
|||
self.ident_updated_at ||= Time.zone.now # not in use
|
||||
ident_frame = frame.css('ident').first
|
||||
|
||||
if ident_frame && ident_attr_valid?(ident_frame) && ident_country_code.blank? && ident_type.in?(%w(org priv).freeze)
|
||||
at.merge!(ident_country_code: ident_frame.attr('cc'))
|
||||
if ident_frame && ident_attr_valid?(ident_frame)
|
||||
if ident_country_code.blank? && ident_type.in?(%w(org priv).freeze)
|
||||
at.merge!(ident_country_code: ident_frame.attr('cc'))
|
||||
end
|
||||
if ident_type == "birthday" && ident !=~ /\d{4}-\d{2}-\d{2}/
|
||||
at.merge!(ident: ident_frame.text)
|
||||
end
|
||||
end
|
||||
|
||||
# Deprecated
|
||||
# if ident_updated_at.present?
|
||||
# throw :epp_error, {
|
||||
# code: '2306',
|
||||
# msg: I18n.t(:ident_update_error)
|
||||
# }
|
||||
# else
|
||||
# at.merge!(self.class.ident_attrs(frame.css('ident').first))
|
||||
# self.ident_updated_at = Time.zone.now
|
||||
# end
|
||||
end
|
||||
|
||||
super(at)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue