Always try to set `runas_user
` etc. when making an importer
er, when it's being made by the handler at least
This commit is contained in:
parent
6ac352bc93
commit
06afadbe2a
|
@ -133,8 +133,15 @@ class ImportHandler(object):
|
|||
kwargs.setdefault('direction', self.direction)
|
||||
if hasattr(self, 'batch_size'):
|
||||
kwargs.setdefault('batch_size', self.batch_size)
|
||||
if hasattr(self, 'runas_username') and self.runas_username:
|
||||
kwargs['runas_username'] = self.runas_username
|
||||
if hasattr(self, 'runas_user') and self.runas_user:
|
||||
kwargs['runas_user'] = self.runas_user
|
||||
kwargs['runas_username'] = self.runas_user.username
|
||||
kwargs = self.get_importer_kwargs(key, **kwargs)
|
||||
kwargs['key'] = kwargs.pop('key_fields', None)
|
||||
if hasattr(self, 'args') and 'args' not in kwargs:
|
||||
kwargs['args'] = self.args
|
||||
return self.importers[key](**kwargs)
|
||||
|
||||
def get_importer_kwargs(self, key, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue