"Refactor backend configuration and setup for improved maintainability (feat)"
This commit is contained in:
@@ -1952,19 +1952,7 @@ else:
|
||||
|
||||
with app.app_context():
|
||||
init_db()
|
||||
printers_config = json.loads(app.config.get('PRINTERS', '{}'))
|
||||
printers_config = app.config.get('PRINTERS', {})
|
||||
if printers_config:
|
||||
init_printers()
|
||||
setup_frontend_v2()
|
||||
|
||||
# Parse PRINTERS als JSON
|
||||
printers_env = app.config.get('PRINTERS', '{}')
|
||||
if isinstance(printers_env, str):
|
||||
try:
|
||||
app.config['PRINTERS'] = json.loads(printers_env)
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
app.config['PRINTERS'] = {}
|
||||
elif isinstance(printers_env, dict):
|
||||
app.config['PRINTERS'] = printers_env
|
||||
else:
|
||||
app.config['PRINTERS'] = {}
|
||||
setup_frontend_v2()
|
Reference in New Issue
Block a user