mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-30 23:03:02 +00:00 
			
		
		
		
	Bugfix change password on commandline
This commit is contained in:
		| @@ -112,16 +112,18 @@ def create_app(): | ||||
|  | ||||
|     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 | ||||
|     encrypt_key, error = config_sql.get_encryption_key(os.path.dirname(cli_param.settings_path)) | ||||
|  | ||||
|     config_sql.load_configuration(ub.session, encrypt_key) | ||||
|     config.init_config(ub.session, encrypt_key, cli_param) | ||||
|  | ||||
|     if error: | ||||
|         log.error(error) | ||||
|  | ||||
|     ub.password_change(cli_param.user_credentials) | ||||
|  | ||||
|     if not limiter: | ||||
|         log.info('*** "flask-limiter" is needed for calibre-web to run. ' | ||||
|                  'Please install it using pip: "pip install flask-limiter" ***') | ||||
|   | ||||
| @@ -818,7 +818,7 @@ def init_db_thread(): | ||||
|     return Session() | ||||
|  | ||||
|  | ||||
| def init_db(app_db_path, user_credentials=None): | ||||
| def init_db(app_db_path): | ||||
|     # Open session for database connection | ||||
|     global session | ||||
|     global app_DB_path | ||||
| @@ -839,6 +839,7 @@ def init_db(app_db_path, user_credentials=None): | ||||
|         create_admin_user(session) | ||||
|         create_anonymous_user(session) | ||||
|  | ||||
| def password_change(user_credentials=None): | ||||
|     if user_credentials: | ||||
|         username, password = user_credentials.split(':', 1) | ||||
|         user = session.query(User).filter(func.lower(User.name) == username.lower()).first() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ozzie Isaacs
					Ozzie Isaacs