... if authed(): user = get_current_user() team = get_current_team()
# TODO: Convert this into a re-useable decorator if is_admin(): pass else: if config.is_teams_mode() and team isNone: abort(403)
unlocked_hints = { u.target for u in HintUnlocks.query.filter_by( type="hints", account_id=user.account_id ) } files = [] for f in chal.files: token = { "user_id": user.id, "team_id": team.idif team elseNone, "file_id": f.id, } files.append(urllib.parse.unquote( url_for("views.files", path=f.location, token=serialize(token)))) else: files = [ urllib.parse.unquote(url_for("views.files", path=f.location)) for f in chal.files ] ...