mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-25 09:30:31 +00:00
Bugfix change password on commandline
This commit is contained in:
parent
8ee34bf428
commit
7ca07f06ce
@ -112,16 +112,18 @@ def create_app():
|
|||||||
|
|
||||||
cli_param.init()
|
cli_param.init()
|
||||||
|
|
||||||
ub.init_db(cli_param.settings_path, cli_param.user_credentials)
|
ub.init_db(cli_param.settings_path)
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
encrypt_key, error = config_sql.get_encryption_key(os.path.dirname(cli_param.settings_path))
|
encrypt_key, error = config_sql.get_encryption_key(os.path.dirname(cli_param.settings_path))
|
||||||
|
|
||||||
config_sql.load_configuration(ub.session, encrypt_key)
|
config_sql.load_configuration(ub.session, encrypt_key)
|
||||||
config.init_config(ub.session, encrypt_key, cli_param)
|
config.init_config(ub.session, encrypt_key, cli_param)
|
||||||
|
|
||||||
if error:
|
if error:
|
||||||
log.error(error)
|
log.error(error)
|
||||||
|
|
||||||
|
ub.password_change(cli_param.user_credentials)
|
||||||
|
|
||||||
if not limiter:
|
if not limiter:
|
||||||
log.info('*** "flask-limiter" is needed for calibre-web to run. '
|
log.info('*** "flask-limiter" is needed for calibre-web to run. '
|
||||||
'Please install it using pip: "pip install flask-limiter" ***')
|
'Please install it using pip: "pip install flask-limiter" ***')
|
||||||
|
@ -818,7 +818,7 @@ def init_db_thread():
|
|||||||
return Session()
|
return Session()
|
||||||
|
|
||||||
|
|
||||||
def init_db(app_db_path, user_credentials=None):
|
def init_db(app_db_path):
|
||||||
# Open session for database connection
|
# Open session for database connection
|
||||||
global session
|
global session
|
||||||
global app_DB_path
|
global app_DB_path
|
||||||
@ -839,6 +839,7 @@ def init_db(app_db_path, user_credentials=None):
|
|||||||
create_admin_user(session)
|
create_admin_user(session)
|
||||||
create_anonymous_user(session)
|
create_anonymous_user(session)
|
||||||
|
|
||||||
|
def password_change(user_credentials=None):
|
||||||
if user_credentials:
|
if user_credentials:
|
||||||
username, password = user_credentials.split(':', 1)
|
username, password = user_credentials.split(':', 1)
|
||||||
user = session.query(User).filter(func.lower(User.name) == username.lower()).first()
|
user = session.query(User).filter(func.lower(User.name) == username.lower()).first()
|
||||||
|
Loading…
Reference in New Issue
Block a user