isnot-fix

This commit is contained in:
Untone 2023-11-29 13:44:40 +03:00
parent af761f916f
commit 6bac6b737e
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ def add_reaction_stat_columns(q):
q = q.outerjoin(aliased_reaction, Reaction.id == aliased_reaction.reply_to).add_columns(
func.sum(aliased_reaction.id).label("reacted_stat"),
func.sum(case((aliased_reaction.body.is_not(""), 1), else_=0)).label("commented_stat"),
func.sum(case((aliased_reaction.body != "", 1), else_=0)).label("commented_stat"),
func.sum(
case(
(aliased_reaction.kind == ReactionKind.AGREE, 1),
@ -91,7 +91,7 @@ def is_published_author(session, author_id):
return (
session.query(Shout)
.where(Shout.authors.contains(author_id))
.filter(and_(Shout.published_at.is_not(""), Shout.deleted_at.is_(None)))
.filter(and_(Shout.published_at !="", Shout.deleted_at.is_(None)))
.count()
> 0
)

View File

@ -209,7 +209,7 @@ async def load_shouts_feed(_, info, options):
)
.where(
and_(
Shout.published_at.is_not(None),
Shout.published_at != None,
Shout.deleted_at.is_(None),
Shout.id.in_(subquery),
)