Fix DB_FLAVOR condition testing for models.py

master
Tim Möhlmann 6 years ago
parent 0f3c1b9d15
commit 47a3fd47b5
No known key found for this signature in database
GPG Key ID: 8677988D8072E8DE

@ -66,16 +66,20 @@ class ConfigManager(dict):
def __init__(self): def __init__(self):
self.config = dict() self.config = dict()
self.parse_env()
def init_app(self, app): def init_app(self, app):
self.config.update(app.config) self.config.update(app.config)
self.parse_env()
if self.config['DB_FLAVOR'] != 'sqlite':
self.setsql()
app.config = self
def parse_env(self):
self.config.update({ self.config.update({
key: os.environ.get(key, value) key: os.environ.get(key, value)
for key, value in DEFAULT_CONFIG.items() for key, value in DEFAULT_CONFIG.items()
}) })
if self.config['DB_FLAVOR'] != 'sqlite':
self.setsql()
app.config = self
def setsql(self): def setsql(self):
if not self.config['DB_PW']: if not self.config['DB_PW']:

Loading…
Cancel
Save