fixed formatting

blueprint_refactoring
Simon Pirkelmann 2022-09-12 22:20:06 +02:00
parent 6d9e90631a
commit 5fb652c1d2
1 changed files with 8 additions and 5 deletions

View File

@ -11,7 +11,7 @@ security = Security()
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):
admin_file = Path(app.config.get('ADMIN_FILE'))
@ -37,8 +37,10 @@ def create_super_admins(app, user_datastore):
'password': pw})
except Exception as e:
app.logger.error(
f"Error while parsing line {i} in admin config file. Config file should contain lines of "
f"'<username> <email> <password>\\n'\n Exception: {e}\nAdmin account could not be created."
f"Error while parsing line {i} in admin config file. "
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():
@ -73,10 +75,11 @@ def create_super_admins(app, user_datastore):
def create_app():
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)
token_file = Path(app.config.get('TOKEN_FILE'))
if not token_file.exists():
app.logger.warning(