Reset current_user_id before execute backends.

This commit is contained in:
Martin Edenhofer 2016-04-26 08:02:10 +02:00
parent 54a41212df
commit af3087abea
2 changed files with 1 additions and 2 deletions

View file

@ -24,6 +24,7 @@ class Transaction::BackgroundJob
Setting.where(area: 'Transaction::Backend').order(:name).each {|setting| Setting.where(area: 'Transaction::Backend').order(:name).each {|setting|
backend = Setting.get(setting.name) backend = Setting.get(setting.name)
begin begin
UserInfo.current_user_id = 1
integration = Kernel.const_get(backend).new(@item, @params) integration = Kernel.const_get(backend).new(@item, @params)
integration.perform integration.perform
rescue => e rescue => e

View file

@ -162,8 +162,6 @@ class Transaction::ClearbitEnrichment
if !organization if !organization
organization = Organization.new( organization = Organization.new(
shared: config['organization_shared'], shared: config['organization_shared'],
updated_by_id: 1,
created_by_id: 1,
) )
organization_sync_values.each {|destination, value| organization_sync_values.each {|destination, value|
attribute = destination.sub(/^organization\./, '') attribute = destination.sub(/^organization\./, '')