diff --git a/server/szurubooru/func/image_hash.py b/server/szurubooru/func/image_hash.py index 653ac47c..00626d3f 100644 --- a/server/szurubooru/func/image_hash.py +++ b/server/szurubooru/func/image_hash.py @@ -40,9 +40,9 @@ def search_by_image(image_content): 'dist': result['dist'], 'path': result['path'], } - except elasticsearch.exceptions.ElasticsearchException as ex: + except elasticsearch.exceptions.ElasticsearchException: raise - except Exception as ex: + except Exception: raise errors.SearchError('Error searching (invalid input?)') diff --git a/server/szurubooru/migrations/env.py b/server/szurubooru/migrations/env.py index 2f7c1122..1359ab8a 100644 --- a/server/szurubooru/migrations/env.py +++ b/server/szurubooru/migrations/env.py @@ -61,6 +61,7 @@ def run_migrations_online(): with alembic.context.begin_transaction(): alembic.context.run_migrations() + if alembic.context.is_offline_mode(): run_migrations_offline() else: diff --git a/server/szurubooru/search/configs/post_search_config.py b/server/szurubooru/search/configs/post_search_config.py index 55a9f463..b0ea3300 100644 --- a/server/szurubooru/search/configs/post_search_config.py +++ b/server/szurubooru/search/configs/post_search_config.py @@ -66,7 +66,8 @@ def _create_user_filter(): def wrapper(query, criterion, negated): if isinstance(criterion, criteria.PlainCriterion) \ and not criterion.value: - expr = db.Post.user_id == None # sic + # pylint: disable=singleton-comparison + expr = db.Post.user_id == None if negated: expr = ~expr return query.filter(expr)