Skip to content

Commit

Permalink
Merge pull request CTFd#2391 from CTFd/1899-fix-mlc-integration
Browse files Browse the repository at this point in the history
* Properly set core-beta to default
* Fix MLC integration setup in core-beta
* Properly close CTFd#1899
  • Loading branch information
ColdHeat authored Aug 14, 2023
2 parents 2361a3b + eeb8553 commit 4b393db
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CTFd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def set_sqlite_pragma(dbapi_connection, connection_record):
utils.set_config("ctf_version", __version__)

if not utils.get_config("ctf_theme"):
utils.set_config("ctf_theme", DEFAULT_THEME)
utils.set_config("ctf_theme", "core-beta")

update_check(force=True)

Expand Down
8 changes: 0 additions & 8 deletions CTFd/themes/admin/templates/integrations.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{% extends "base.html" %}

{% block stylesheets %}
<style>
#base-navbars {
display: none !important;
}
</style>
{% endblock %}

{% block content %}
<div class="container">
<div class="row">
Expand Down
11 changes: 5 additions & 6 deletions CTFd/themes/core-beta/assets/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,17 @@ Alpine.data("SetupForm", () => ({
},

mlcSetup() {
let q = document.querySelector;
let r = CTFd.config.urlRoot;
let params = {
name: q("#ctf_name").value,
name: document.querySelector("#ctf_name").value,
type: "jeopardy",
description: q("#ctf_description").value,
user_mode: q("#user_mode").value,
description: document.querySelector("#ctf_description").value,
user_mode: document.querySelector("[name=user_mode]:checked").value,
event_url: window.location.origin + r,
redirect_url: window.location.origin + r + "/redirect",
integration_setup_url: window.location.origin + r + "/setup/integrations",
start: q("#start-preview").value,
end: q("#end-preview").value,
start: document.querySelector("#start-preview").value,
end: document.querySelector("#end-preview").value,
platform: "CTFd",
state: window.STATE,
};
Expand Down
1 change: 0 additions & 1 deletion CTFd/themes/core-beta/static/assets/setup.19557623.js

This file was deleted.

1 change: 1 addition & 0 deletions CTFd/themes/core-beta/static/assets/setup.3ae29907.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CTFd/themes/core-beta/static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
]
},
"assets/js/setup.js": {
"file": "assets/setup.19557623.js",
"file": "assets/setup.3ae29907.js",
"src": "assets/js/setup.js",
"isEntry": true,
"imports": [
Expand Down
2 changes: 0 additions & 2 deletions CTFd/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ def setup():

return redirect(url_for("views.static_html"))
try:
if bool(get_config("ctf_theme")) is False:
set_config("ctf_theme", "core-beta")
return render_template("setup.html", state=serialize(generate_nonce()))
except TemplateNotFound:
# Set theme to default and try again
Expand Down

0 comments on commit 4b393db

Please sign in to comment.