mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Fix hardcoded value
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user