mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
* Fix issue where admins could not see user graphs/api data if score visibility was set to hidden * Closes #1580
28 lines
893 B
Python
28 lines
893 B
Python
from flask import Blueprint, render_template
|
|
|
|
from CTFd.cache import cache, make_cache_key
|
|
from CTFd.utils import config
|
|
from CTFd.utils.config.visibility import scores_visible
|
|
from CTFd.utils.decorators.visibility import check_score_visibility
|
|
from CTFd.utils.helpers import get_infos
|
|
from CTFd.utils.scores import get_standings
|
|
from CTFd.utils.user import is_admin
|
|
|
|
scoreboard = Blueprint("scoreboard", __name__)
|
|
|
|
|
|
@scoreboard.route("/scoreboard")
|
|
@check_score_visibility
|
|
@cache.cached(timeout=60, key_prefix=make_cache_key)
|
|
def listing():
|
|
infos = get_infos()
|
|
|
|
if config.is_scoreboard_frozen():
|
|
infos.append("Scoreboard has been frozen")
|
|
|
|
if is_admin() is True and scores_visible() is False:
|
|
infos.append("Scores are not currently visible to users")
|
|
|
|
standings = get_standings()
|
|
return render_template("scoreboard.html", standings=standings, infos=infos)
|