From 82e129a589116ffed4ee483cc35f32fab5bc703b Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 27 Feb 2024 12:58:24 +0300 Subject: [PATCH] less-fields-author-serlect-after-reaction --- services/event_listeners.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/event_listeners.py b/services/event_listeners.py index c13f2895..3e8a5baf 100644 --- a/services/event_listeners.py +++ b/services/event_listeners.py @@ -1,6 +1,6 @@ import asyncio -from sqlalchemy import select, event, cast, String +from sqlalchemy import select, event import json from orm.author import Author, AuthorFollower @@ -77,11 +77,12 @@ def after_reaction_insert(mapper, connection, reaction: Reaction): author_query = select( author_subquery.subquery().c.id, - cast(author_subquery.subquery().c.links, String).label('links') + author_subquery.subquery().c.slug, + author_subquery.subquery().c.created_at, + author_subquery.subquery().c.name, ).select_from(author_subquery.subquery()).union( select( replied_author_subquery.subquery().c.id, - cast(replied_author_subquery.subquery().c.links, String).label('links'), ) .select_from(replied_author_subquery.subquery()) )