From e4cc182db41d0b44dba675367ed04eda56e279dd Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 30 May 2024 14:40:04 +0300 Subject: [PATCH] get-with-stat-debug-2 --- resolvers/stat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resolvers/stat.py b/resolvers/stat.py index 75057c58..bbc3989c 100644 --- a/resolvers/stat.py +++ b/resolvers/stat.py @@ -180,7 +180,8 @@ def get_with_stat(q): try: with local_session() as session: # detect author - is_author = f"{q}".lower().startswith(["select author", "select * from author"]) + author_prefixes = ("select author", "select * from author") + is_author = f"{q}".lower().startswith(author_prefixes) # Add stat columns to the query q = add_author_stat_columns(q) if is_author else add_topic_stat_columns(q)