From c5fc30a1be3dcdee40fd74a5b5df38ebc8394c6f Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Fri, 17 Jun 2022 14:24:23 +0200 Subject: [PATCH] Bugfix error message missing custom read status column Bugfix password validation --- cps/helper.py | 2 +- cps/search.py | 8 +++++--- requirements.txt | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index 60bc1713..11da616d 100755 --- a/cps/helper.py +++ b/cps/helper.py @@ -665,7 +665,7 @@ def valid_password(check_password): if config.config_password_policy: verify = "" if config.config_password_min_length > 0: - verify += "^(?=\S{" + str(config.config_password_min_length) + ",}$)" + verify += "^(?=.{" + str(config.config_password_min_length) + ",}$)" if config.config_password_number: verify += "(?=.*?\d)" if config.config_password_lower: diff --git a/cps/search.py b/cps/search.py index 88d790fc..ada3d116 100644 --- a/cps/search.py +++ b/cps/search.py @@ -17,12 +17,12 @@ import json from datetime import datetime -from flask import Blueprint, request, redirect, url_for, flash +from flask import Blueprint, request, redirect, url_for, flash, get_flashed_messages from flask import session as flask_session from flask_login import current_user from flask_babel import format_date from flask_babel import gettext as _ -from sqlalchemy.sql.expression import func, not_, and_, or_, text, true +from sqlalchemy.sql.expression import func, not_, and_, or_, text, false from sqlalchemy.sql.functions import coalesce from . import logger, db, calibre_db, config, ub @@ -134,7 +134,9 @@ def adv_search_read_status(read_status): db_filter = coalesce(db.cc_classes[config.config_read_column].value, False) != True except (KeyError, AttributeError, IndexError): log.error("Custom Column No.{} does not exist in calibre database".format(config.config_read_column)) - return true() + flash(_("Custom Column No.{} does not exist in calibre database".format(config.config_read_column)), + category="error") + return false() return db_filter diff --git a/requirements.txt b/requirements.txt index acaf4a40..16e9737b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ Flask-Babel>=0.11.1,<2.1.0 Flask-Login>=0.3.2,<0.6.2 Flask-Principal>=0.3.2,<0.5.1 backports_abc>=0.4 -Flask>=1.0.2,<2.1.0 +Flask>=1.0.2,<2.2.0 iso-639>=0.4.5,<0.5.0 PyPDF3>=1.0.0,<1.0.7 pytz>=2016.10