Do not set config defaults, if config says not to

so that we can include corporal as dependency to other projects
without the config interference
This commit is contained in:
Lance Edgar 2021-06-11 17:41:15 -05:00
parent f9db799506
commit dc28dd995a

View file

@ -13,12 +13,15 @@ class CorporalConfig(ConfigExtension):
def configure(self, config): def configure(self, config):
# set some default config values if config.getbool('rattail.config', 'corporal.set_defaults',
config.setdefault('rattail', 'model', 'corporal.db.model') usedb=False, default=True):
config.setdefault('rattail.mail', 'emails', 'corporal.emails')
config.setdefault('rattail', 'settings', 'corporal.settings')
config.setdefault('tailbone', 'menus', 'corporal.web.menus')
config.setdefault('rattail.config', 'templates', 'corporal:data/config rattail:data/config')
# batches # set some default config values
config.setdefault('rattail.batch', 'vendor_catalog.handler', 'corporal.batch.vendorcatalog:VendorCatalogHandler') config.setdefault('rattail', 'model', 'corporal.db.model')
config.setdefault('rattail.mail', 'emails', 'corporal.emails')
config.setdefault('rattail', 'settings', 'corporal.settings')
config.setdefault('tailbone', 'menus', 'corporal.web.menus')
config.setdefault('rattail.config', 'templates', 'corporal:data/config rattail:data/config')
# batches
config.setdefault('rattail.batch', 'vendor_catalog.handler', 'corporal.batch.vendorcatalog:VendorCatalogHandler')