fixed formatting
This commit is contained in:
parent
6d9e90631a
commit
5fb652c1d2
|
@ -11,7 +11,7 @@ security = Security()
|
||||||
db = SQLAlchemy()
|
db = SQLAlchemy()
|
||||||
|
|
||||||
|
|
||||||
# create admin users (only if they don't exists already)
|
# create admin users (only if they don't exist already)
|
||||||
def create_super_admins(app, user_datastore):
|
def create_super_admins(app, user_datastore):
|
||||||
admin_file = Path(app.config.get('ADMIN_FILE'))
|
admin_file = Path(app.config.get('ADMIN_FILE'))
|
||||||
|
|
||||||
|
@ -37,8 +37,10 @@ def create_super_admins(app, user_datastore):
|
||||||
'password': pw})
|
'password': pw})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
app.logger.error(
|
app.logger.error(
|
||||||
f"Error while parsing line {i} in admin config file. Config file should contain lines of "
|
f"Error while parsing line {i} in admin config file. "
|
||||||
f"'<username> <email> <password>\\n'\n Exception: {e}\nAdmin account could not be created."
|
f"Config file should contain lines of <username> "
|
||||||
|
f"<email> <password>\\n'\n "
|
||||||
|
f"Exception: {e}\nAdmin account could not be created."
|
||||||
)
|
)
|
||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
|
@ -73,10 +75,11 @@ def create_super_admins(app, user_datastore):
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_object('imaginaerraum_door_admin.default_app_config.DefaultConfig')
|
app.config.from_object(
|
||||||
|
'imaginaerraum_door_admin.default_app_config.DefaultConfig'
|
||||||
|
)
|
||||||
app.config.from_envvar('APPLICATION_SETTINGS', silent=True)
|
app.config.from_envvar('APPLICATION_SETTINGS', silent=True)
|
||||||
|
|
||||||
|
|
||||||
token_file = Path(app.config.get('TOKEN_FILE'))
|
token_file = Path(app.config.get('TOKEN_FILE'))
|
||||||
if not token_file.exists():
|
if not token_file.exists():
|
||||||
app.logger.warning(
|
app.logger.warning(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user