This commit is contained in:
@@ -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))
|
||||
|
Reference in New Issue
Block a user