Fixed bug: Empty ImportJob payload store defaults to an empty Hash which will start the LDAP import without a config.

This commit is contained in:
Thorsten Eckel 2017-04-19 14:59:48 +02:00
parent feef4211f7
commit e98b14b757

View file

@ -5,8 +5,13 @@ module Import
def self.import(config: nil, ldap: nil, **kargs)
config ||= Setting.get('ldap_config')
ldap ||= ::Ldap.new(config)
# config might be an empty Hash due to the ImportJob payload
# store column which will be an empty hash if the content is NULL
if config.blank?
config = Setting.get('ldap_config')
end
ldap ||= ::Ldap.new(config)
@config = config
@ldap = ldap