Rename events.py and related to 'special'.

For @geese-suck's namespace conflict.
pull/31/head
Snakes 2022-11-28 22:35:36 -05:00
parent bf1da34dae
commit d6680a29a3
Signed by: Snakes
GPG Key ID: E745A82778055C7E
3 changed files with 7 additions and 7 deletions

View File

@ -47,4 +47,4 @@ if FEATURES['ASSET_SUBMISSIONS']:
from .asset_submissions import *
if FEATURES['STREAMERS']:
from .streamers import *
from .events import *
from .special import *

View File

@ -4,7 +4,7 @@ from files.helpers.get import get_accounts_dict
from files.routes.wrappers import auth_required
from files.__main__ import app, cache
_event_leaderboard_query = """
_special_leaderboard_query = """
WITH bet_options AS (
SELECT p.id AS submission_id, so.id AS option_id, so.exclusive, cnt.count
FROM submission_options so
@ -73,16 +73,16 @@ ORDER BY payout DESC, bets_won DESC, bets_total ASC;
"""
@cache.memoize(timeout=60)
def _event_leaderboard_get():
result = g.db.execute(_event_leaderboard_query).all()
def _special_leaderboard_get():
result = g.db.execute(_special_leaderboard_query).all()
return result
@app.get('/events/worldcup2022/leaderboard')
@app.get('/special/worldcup2022/leaderboard')
@auth_required
def get_leaderboard(v):
result = _event_leaderboard_get()
result = _special_leaderboard_get()
if g.is_api_or_xhr: return jsonify(result)
users = get_accounts_dict([r[0] for r in result],
v=v, include_shadowbanned=False)
return render_template("event/worldcup22_leaderboard.html",
return render_template("special/worldcup22_leaderboard.html",
v=v, result=result, users=users)