Fix lints

This commit is contained in:
Kevin Chung
2023-06-27 04:06:26 -04:00
parent 2ec1db3537
commit 8837d5c955
2 changed files with 10 additions and 13 deletions

View File

@@ -3,7 +3,10 @@ from flask import abort, render_template, request, url_for
from CTFd.admin import admin from CTFd.admin import admin
from CTFd.models import Challenges, Flags, Solves from CTFd.models import Challenges, Flags, Solves
from CTFd.plugins.challenges import CHALLENGE_CLASSES, get_chal_class from CTFd.plugins.challenges import CHALLENGE_CLASSES, get_chal_class
from CTFd.schemas.tags import TagSchema
from CTFd.utils.decorators import admins_only from CTFd.utils.decorators import admins_only
from CTFd.utils.security.signing import serialize
from CTFd.utils.user import get_current_team, get_current_user
@admin.route("/admin/challenges") @admin.route("/admin/challenges")
@@ -71,13 +74,6 @@ def challenges_detail(challenge_id):
) )
from CTFd.utils.security.signing import serialize
from CTFd.utils.user import (
get_current_team,
get_current_user,
)
from CTFd.schemas.tags import TagSchema
@admin.route("/admin/challenges/preview/<int:challenge_id>") @admin.route("/admin/challenges/preview/<int:challenge_id>")
@admins_only @admins_only
def challenges_preview(challenge_id): def challenges_preview(challenge_id):
@@ -93,9 +89,7 @@ def challenges_preview(challenge_id):
"team_id": team.id if team else None, "team_id": team.id if team else None,
"file_id": f.id, "file_id": f.id,
} }
files.append( files.append(url_for("views.files", path=f.location, token=serialize(token)))
url_for("views.files", path=f.location, token=serialize(token))
)
tags = [ tags = [
tag["value"] for tag in TagSchema("user", many=True).dump(challenge.tags).data tag["value"] for tag in TagSchema("user", many=True).dump(challenge.tags).data

View File

@@ -17,7 +17,6 @@ import ChallengeFilesList from "../components/files/ChallengeFilesList.vue";
import HintsList from "../components/hints/HintsList.vue"; import HintsList from "../components/hints/HintsList.vue";
import NextChallenge from "../components/next/NextChallenge.vue"; import NextChallenge from "../components/next/NextChallenge.vue";
function loadChalTemplate(challenge) { function loadChalTemplate(challenge) {
CTFd._internal.challenge = {}; CTFd._internal.challenge = {};
$.getScript(CTFd.config.urlRoot + challenge.scripts.view, function() { $.getScript(CTFd.config.urlRoot + challenge.scripts.view, function() {
@@ -140,8 +139,12 @@ function handleChallengeOptions(event) {
$(() => { $(() => {
$(".preview-challenge").click(function(_e) { $(".preview-challenge").click(function(_e) {
let url = `${CTFd.config.urlRoot}/admin/challenges/preview/${window.CHALLENGE_ID}`; let url = `${CTFd.config.urlRoot}/admin/challenges/preview/${
$("#challenge-window").html(`<iframe src="${url}" height="100%" width="100%" frameBorder=0></iframe>`); window.CHALLENGE_ID
}`;
$("#challenge-window").html(
`<iframe src="${url}" height="100%" width="100%" frameBorder=0></iframe>`
);
$("#challenge-modal").modal(); $("#challenge-modal").modal();
}); });