Use SQLAlchemy boolean

Seems to make a difference sometimes.

Ref #300
This commit is contained in:
Jonathan Rehm 2017-08-28 09:28:48 -07:00
parent a8b53ab38a
commit 6b8de017ab

View File

@ -511,7 +511,7 @@ def common_filters():
if current_user.filter_language() != "all": if current_user.filter_language() != "all":
lang_filter = db.Books.languages.any(db.Languages.lang_code == current_user.filter_language()) lang_filter = db.Books.languages.any(db.Languages.lang_code == current_user.filter_language())
else: else:
lang_filter = True lang_filter = true()
content_rating_filter = false() if current_user.mature_content else \ content_rating_filter = false() if current_user.mature_content else \
db.Books.tags.any(db.Tags.name.in_(config.mature_content_tags())) db.Books.tags.any(db.Tags.name.in_(config.mature_content_tags()))
return and_(lang_filter, ~content_rating_filter) return and_(lang_filter, ~content_rating_filter)