Changed config handler
Added printout when instance folder is not found.
This commit is contained in:
parent
77b0bcb94a
commit
aac63b7eb3
@ -2,7 +2,6 @@ from flask import request, jsonify, Flask
|
|||||||
import json
|
import json
|
||||||
from datetime import date
|
from datetime import date
|
||||||
import tomllib
|
import tomllib
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@ -25,8 +24,11 @@ def create_app(test_config=None):
|
|||||||
app.config.from_mapping(test_config)
|
app.config.from_mapping(test_config)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.makedirs(app.instance_path)
|
os.makedirs(app.instance_path, exist_ok=True)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
print(
|
||||||
|
"Error: instance path not found!" +
|
||||||
|
" No configuration file has been loaded")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
import bcnsGDSAPI.modules.db_connect
|
import bcnsGDSAPI.modules.db_connect
|
||||||
|
|||||||
@ -35,8 +35,11 @@ def create_app(test_config=None):
|
|||||||
|
|
||||||
# ensure the instance folder exists
|
# ensure the instance folder exists
|
||||||
try:
|
try:
|
||||||
os.makedirs(app.instance_path)
|
os.makedirs(app.instance_path, exist_ok=True)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
print(
|
||||||
|
"Error: Instance-path not found!" +
|
||||||
|
" No configuration-file has been loaded")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
bcnsGDSSite.modules.init.init(app.config)
|
bcnsGDSSite.modules.init.init(app.config)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user