Fallback to default handler when no config available
e.g. when showing help for the command
This commit is contained in:
parent
fa1e0c93e2
commit
2b8478ef0b
|
@ -46,8 +46,11 @@ class ImportCOREPOS(commands.ImportSubcommand):
|
|||
"Defaults to 'default'.")
|
||||
|
||||
def get_handler_factory(self, **kwargs):
|
||||
spec = self.config.get('rattail.importing', 'corepos.handler',
|
||||
default='rattail_corepos.importing.corepos:FromCOREPOSToRattail')
|
||||
if self.config:
|
||||
spec = self.config.get('rattail.importing', 'corepos.handler',
|
||||
default='rattail_corepos.importing.corepos:FromCOREPOSToRattail')
|
||||
else:
|
||||
spec = 'rattail_corepos.importing.corepos:FromCOREPOSToRattail'
|
||||
return load_object(spec)
|
||||
|
||||
def get_handler_kwargs(self, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue