Improved error handling.
This commit is contained in:
parent
7565018702
commit
d31daac4ef
1 changed files with 3 additions and 3 deletions
|
@ -48,7 +48,7 @@ class Transaction::ClearbitEnrichment
|
||||||
|
|
||||||
def self.sync_user(user)
|
def self.sync_user(user)
|
||||||
|
|
||||||
return if !user.email
|
return if user.email.empty?
|
||||||
data = fetch(user.email)
|
data = fetch(user.email)
|
||||||
#p 'OO: ' + data.inspect
|
#p 'OO: ' + data.inspect
|
||||||
return if !data
|
return if !data
|
||||||
|
@ -131,8 +131,8 @@ class Transaction::ClearbitEnrichment
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# if no company record exists
|
# if no company record exists or no organization should be created
|
||||||
if !data['company']
|
if !data['company'] || config['organization_autocreate'] != true
|
||||||
if user_has_changed
|
if user_has_changed
|
||||||
user.save
|
user.save
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue