isnot-fix
This commit is contained in:
parent
af761f916f
commit
6bac6b737e
|
@ -17,7 +17,7 @@ def add_reaction_stat_columns(q):
|
||||||
|
|
||||||
q = q.outerjoin(aliased_reaction, Reaction.id == aliased_reaction.reply_to).add_columns(
|
q = q.outerjoin(aliased_reaction, Reaction.id == aliased_reaction.reply_to).add_columns(
|
||||||
func.sum(aliased_reaction.id).label("reacted_stat"),
|
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(
|
func.sum(
|
||||||
case(
|
case(
|
||||||
(aliased_reaction.kind == ReactionKind.AGREE, 1),
|
(aliased_reaction.kind == ReactionKind.AGREE, 1),
|
||||||
|
@ -91,7 +91,7 @@ def is_published_author(session, author_id):
|
||||||
return (
|
return (
|
||||||
session.query(Shout)
|
session.query(Shout)
|
||||||
.where(Shout.authors.contains(author_id))
|
.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()
|
.count()
|
||||||
> 0
|
> 0
|
||||||
)
|
)
|
||||||
|
|
|
@ -209,7 +209,7 @@ async def load_shouts_feed(_, info, options):
|
||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
and_(
|
and_(
|
||||||
Shout.published_at.is_not(None),
|
Shout.published_at != None,
|
||||||
Shout.deleted_at.is_(None),
|
Shout.deleted_at.is_(None),
|
||||||
Shout.id.in_(subquery),
|
Shout.id.in_(subquery),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user