int-id-fix
All checks were successful
Deploy on push / deploy (push) Successful in 5m45s

This commit is contained in:
2024-02-24 21:15:11 +03:00
parent 5e72a08e0f
commit d7c9622ffa
6 changed files with 21 additions and 24 deletions

View File

@@ -207,7 +207,7 @@ async def load_shouts_drafts(_, info):
with local_session() as session:
reader = session.query(Author).filter(Author.user == user_id).first()
if isinstance(reader, Author):
q = q.filter(Shout.created_by == int(reader.id))
q = q.filter(Shout.created_by == reader.id)
q = q.group_by(Shout.id)
for [shout] in session.execute(q).unique():
main_topic = (
@@ -240,16 +240,16 @@ async def load_shouts_feed(_, info, options):
reader = session.query(Author).filter(Author.user == user_id).first()
if reader:
reader_followed_authors = select(AuthorFollower.author).where(
AuthorFollower.follower == int(reader.id)
AuthorFollower.follower == reader.id
)
reader_followed_topics = select(TopicFollower.topic).where(
TopicFollower.follower == int(reader.id)
TopicFollower.follower == reader.id
)
subquery = (
select(Shout.id)
.where(Shout.id == int(ShoutAuthor.shout))
.where(Shout.id == int(ShoutTopic.shout))
.where(Shout.id == ShoutAuthor.shout)
.where(Shout.id == ShoutTopic.shout)
.where(
(ShoutAuthor.author.in_(reader_followed_authors))
| (ShoutTopic.topic.in_(reader_followed_topics))