server: make pylint happier
This commit is contained in:
parent
902a0d3fe0
commit
627574a9c2
3 changed files with 5 additions and 3 deletions
|
@ -40,9 +40,9 @@ def search_by_image(image_content):
|
||||||
'dist': result['dist'],
|
'dist': result['dist'],
|
||||||
'path': result['path'],
|
'path': result['path'],
|
||||||
}
|
}
|
||||||
except elasticsearch.exceptions.ElasticsearchException as ex:
|
except elasticsearch.exceptions.ElasticsearchException:
|
||||||
raise
|
raise
|
||||||
except Exception as ex:
|
except Exception:
|
||||||
raise errors.SearchError('Error searching (invalid input?)')
|
raise errors.SearchError('Error searching (invalid input?)')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ def run_migrations_online():
|
||||||
with alembic.context.begin_transaction():
|
with alembic.context.begin_transaction():
|
||||||
alembic.context.run_migrations()
|
alembic.context.run_migrations()
|
||||||
|
|
||||||
|
|
||||||
if alembic.context.is_offline_mode():
|
if alembic.context.is_offline_mode():
|
||||||
run_migrations_offline()
|
run_migrations_offline()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -66,7 +66,8 @@ def _create_user_filter():
|
||||||
def wrapper(query, criterion, negated):
|
def wrapper(query, criterion, negated):
|
||||||
if isinstance(criterion, criteria.PlainCriterion) \
|
if isinstance(criterion, criteria.PlainCriterion) \
|
||||||
and not criterion.value:
|
and not criterion.value:
|
||||||
expr = db.Post.user_id == None # sic
|
# pylint: disable=singleton-comparison
|
||||||
|
expr = db.Post.user_id == None
|
||||||
if negated:
|
if negated:
|
||||||
expr = ~expr
|
expr = ~expr
|
||||||
return query.filter(expr)
|
return query.filter(expr)
|
||||||
|
|
Loading…
Reference in a new issue