Revert "Update contact(s) name based on eIdentity data from Registrant API"

This reverts commit 7a6568c34a.
This commit is contained in:
Karl Erik Õunapuu 2020-11-03 14:37:35 +02:00
parent c72ca8d157
commit f5e0e811d9
No known key found for this signature in database
GPG key ID: C9DD647298A34764

View file

@ -2,7 +2,6 @@ class RegistrantUser < User
attr_accessor :idc_data attr_accessor :idc_data
devise :trackable, :timeoutable devise :trackable, :timeoutable
after_save :update_related_contacts
def ability def ability
@ability ||= Ability.new(self) @ability ||= Ability.new(self)
@ -55,12 +54,6 @@ class RegistrantUser < User
username.split.second username.split.second
end end
def update_related_contacts
cc, idcode = registrant_ident.split('-')
contacts = Contact.where(ident: idcode, country_code: cc).where('name != ?', username)
contacts.each { |c| c.update(name: username) }
end
class << self class << self
def find_or_create_by_api_data(user_data = {}) def find_or_create_by_api_data(user_data = {})
return false unless user_data[:ident] return false unless user_data[:ident]