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
|
||||
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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user