From fdda74a008cd9ab304fb5396361cfdcf62789c21 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 2 Mar 2023 02:27:17 +0200 Subject: [PATCH] fix 500 error with newest sqlalchemy version --- files/routes/special.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/routes/special.py b/files/routes/special.py index 508ef6da2..32639a422 100644 --- a/files/routes/special.py +++ b/files/routes/special.py @@ -1,4 +1,6 @@ from flask import g, render_template +from sqlalchemy.sql import text + from files.helpers.get import get_accounts_dict from files.helpers.config.const import * @@ -6,7 +8,7 @@ from files.routes.wrappers import * from files.__main__ import app, cache, limiter -_special_leaderboard_query = """ +_special_leaderboard_query = text(""" WITH bet_options AS ( SELECT p.id AS submission_id, so.id AS option_id, so.exclusive, cnt.count FROM submission_options so @@ -72,7 +74,7 @@ LEFT OUTER JOIN ( SELECT user_id, SUM(payout) AS net FROM bet_votes GROUP BY user_id ) AS bet_payout ON bettors.user_id = bet_payout.user_id ORDER BY payout DESC, bets_won DESC, bets_total ASC; -""" +""") @cache.memoize() def _special_leaderboard_get():