"Update backend configuration and tests for improved stability"
This commit is contained in:
@@ -90,6 +90,18 @@ def create_app(config_name=None):
|
||||
# Hintergrund-Tasks registrieren
|
||||
register_background_tasks(app)
|
||||
|
||||
# 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'] = {}
|
||||
|
||||
return app
|
||||
|
||||
# Initialisierung - wird später durch create_app ersetzt
|
||||
@@ -1943,4 +1955,16 @@ else:
|
||||
printers_config = json.loads(app.config.get('PRINTERS', '{}'))
|
||||
if printers_config:
|
||||
init_printers()
|
||||
setup_frontend_v2()
|
||||
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'] = {}
|
Reference in New Issue
Block a user