Move secret key generation before we load users of config, as they may reference it
This commit is contained in:
parent
1450b7e84c
commit
e56115d9d2
1 changed files with 5 additions and 5 deletions
10
app.py
10
app.py
|
@ -106,6 +106,11 @@ for handler in logging.getLogger().handlers:
|
||||||
|
|
||||||
app.request_class = RequestWithId
|
app.request_class = RequestWithId
|
||||||
|
|
||||||
|
# Generate a secret key if none was specified.
|
||||||
|
if app.config['SECRET_KEY'] is None:
|
||||||
|
logger.debug('Generating in-memory secret key')
|
||||||
|
app.config['SECRET_KEY'] = generate_secret_key()
|
||||||
|
|
||||||
features.import_features(app.config)
|
features.import_features(app.config)
|
||||||
|
|
||||||
Principal(app, use_sessions=False)
|
Principal(app, use_sessions=False)
|
||||||
|
@ -144,11 +149,6 @@ database.configure(app.config)
|
||||||
model.config.app_config = app.config
|
model.config.app_config = app.config
|
||||||
model.config.store = storage
|
model.config.store = storage
|
||||||
|
|
||||||
# Generate a secret key if none was specified.
|
|
||||||
if app.config['SECRET_KEY'] is None:
|
|
||||||
logger.debug('Generating in-memory secret key')
|
|
||||||
app.config['SECRET_KEY'] = generate_secret_key()
|
|
||||||
|
|
||||||
@login_manager.user_loader
|
@login_manager.user_loader
|
||||||
def load_user(user_uuid):
|
def load_user(user_uuid):
|
||||||
logger.debug('User loader loading deferred user with uuid: %s' % user_uuid)
|
logger.debug('User loader loading deferred user with uuid: %s' % user_uuid)
|
||||||
|
|
Reference in a new issue