Changed config handler

Added printout when instance folder is not found.
This commit is contained in:
odecif 2023-11-21 13:02:45 +01:00
parent 77b0bcb94a
commit aac63b7eb3
2 changed files with 8 additions and 3 deletions

View File

@ -2,7 +2,6 @@ from flask import request, jsonify, Flask
import json
from datetime import date
import tomllib
import sys
import os
@ -25,8 +24,11 @@ def create_app(test_config=None):
app.config.from_mapping(test_config)
try:
os.makedirs(app.instance_path)
os.makedirs(app.instance_path, exist_ok=True)
except OSError:
print(
"Error: instance path not found!" +
" No configuration file has been loaded")
pass
import bcnsGDSAPI.modules.db_connect

View File

@ -35,8 +35,11 @@ def create_app(test_config=None):
# ensure the instance folder exists
try:
os.makedirs(app.instance_path)
os.makedirs(app.instance_path, exist_ok=True)
except OSError:
print(
"Error: Instance-path not found!" +
" No configuration-file has been loaded")
pass
bcnsGDSSite.modules.init.init(app.config)