Fix hardcoded value

This commit is contained in:
Kevin Chung
2023-06-27 04:38:24 -04:00
parent e2b8c2de07
commit 6c97610ea4
2 changed files with 7 additions and 2 deletions

View File

@@ -106,7 +106,9 @@ def challenges_preview(challenge_id):
attempts=0,
challenge=challenge,
)
return render_template("admin/challenges/preview.html", content=content)
return render_template(
"admin/challenges/preview.html", content=content, challenge=challenge
)
@admin.route("/admin/challenges/new")

View File

@@ -1,6 +1,9 @@
{% extends "page.html" %}
{% block scripts %}
<script>
var CHALLENGE_ID = {{ challenge.id }};
</script>
{% if "beta" in Configs.ctf_theme %}
{{ Assets.js("assets/js/challenges.js") }}
{% else %}
@@ -127,7 +130,7 @@
CTFd._internal.challenge = {};
$.get(
CTFd.config.urlRoot + "/api/v1/challenges/1",
CTFd.config.urlRoot + "/api/v1/challenges/" + window.CHALLENGE_ID,
function (response) {
// Preview should not show any solves
var challenge_data = response.data;