forked from MarseyWorld/MarseyWorld
fix 500 error with newest sqlalchemy version
parent
12a5ffab0d
commit
fdda74a008
|
@ -1,4 +1,6 @@
|
||||||
from flask import g, render_template
|
from flask import g, render_template
|
||||||
|
from sqlalchemy.sql import text
|
||||||
|
|
||||||
from files.helpers.get import get_accounts_dict
|
from files.helpers.get import get_accounts_dict
|
||||||
from files.helpers.config.const import *
|
from files.helpers.config.const import *
|
||||||
|
|
||||||
|
@ -6,7 +8,7 @@ from files.routes.wrappers import *
|
||||||
|
|
||||||
from files.__main__ import app, cache, limiter
|
from files.__main__ import app, cache, limiter
|
||||||
|
|
||||||
_special_leaderboard_query = """
|
_special_leaderboard_query = text("""
|
||||||
WITH bet_options AS (
|
WITH bet_options AS (
|
||||||
SELECT p.id AS submission_id, so.id AS option_id, so.exclusive, cnt.count
|
SELECT p.id AS submission_id, so.id AS option_id, so.exclusive, cnt.count
|
||||||
FROM submission_options so
|
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
|
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
|
) AS bet_payout ON bettors.user_id = bet_payout.user_id
|
||||||
ORDER BY payout DESC, bets_won DESC, bets_total ASC;
|
ORDER BY payout DESC, bets_won DESC, bets_total ASC;
|
||||||
"""
|
""")
|
||||||
|
|
||||||
@cache.memoize()
|
@cache.memoize()
|
||||||
def _special_leaderboard_get():
|
def _special_leaderboard_get():
|
||||||
|
|
Loading…
Reference in New Issue