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):
self.config = dict()
self.parse_env()
def init_app(self, app):
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({
key: os.environ.get(key, value)
for key, value in DEFAULT_CONFIG.items()
})
if self.config['DB_FLAVOR'] != 'sqlite':
self.setsql()
app.config = self
def setsql(self):
if not self.config['DB_PW']:

Loading…
Cancel
Save