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:
Vladimir Krylov 2015-12-08 10:40:52 +02:00
parent 9d6fc7140d
commit 58bc4cc13b

View file

@ -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)