next bp error fix
This commit is contained in:
parent
aec34c7fd1
commit
83b22ecc4c
@ -1,4 +1,6 @@
|
|||||||
# app/routes/admin.py
|
# app/routes/admin.py
|
||||||
|
import datetime
|
||||||
|
|
||||||
from flask import Blueprint, render_template, request, jsonify, redirect, url_for
|
from flask import Blueprint, render_template, request, jsonify, redirect, url_for
|
||||||
from app.state import current_config
|
from app.state import current_config
|
||||||
from app.utils.helpers import load_configs, load_default_sounds
|
from app.utils.helpers import load_configs, load_default_sounds
|
||||||
|
|||||||
@ -3,6 +3,8 @@ from flask import Blueprint, render_template, redirect, url_for, request, jsonif
|
|||||||
from app.utils.helpers import load_configs, load_default_sounds
|
from app.utils.helpers import load_configs, load_default_sounds
|
||||||
from app.state import current_config, reset_state
|
from app.state import current_config, reset_state
|
||||||
|
|
||||||
|
from config import Config
|
||||||
|
|
||||||
main_bp = Blueprint('main', __name__)
|
main_bp = Blueprint('main', __name__)
|
||||||
|
|
||||||
@main_bp.route('/')
|
@main_bp.route('/')
|
||||||
@ -17,9 +19,10 @@ def index():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@main_bp.route('/configs/<path:filename>')
|
@main_bp.route('/configs/<path:filename>')
|
||||||
|
|
||||||
def serve_config_file(filename):
|
def serve_config_file(filename):
|
||||||
return send_from_directory(app.config['CONFIG_DIR'], filename)
|
return send_from_directory(app.config['CONFIG_DIR'], filename)
|
||||||
|
|
||||||
|
|
||||||
@main_bp.route('/load_config/<filename>')
|
@main_bp.route('/load_config/<filename>')
|
||||||
def load_config(filename):
|
def load_config(filename):
|
||||||
@ -66,7 +69,7 @@ def control_page():
|
|||||||
@main_bp.route('/soundboard')
|
@main_bp.route('/soundboard')
|
||||||
def soundboard():
|
def soundboard():
|
||||||
if current_config is None or 'sounds' not in current_config:
|
if current_config is None or 'sounds' not in current_config:
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('main.index'))
|
||||||
|
|
||||||
sounds = current_config.get('sounds', [])
|
sounds = current_config.get('sounds', [])
|
||||||
return render_template('soundboard.html', sounds=sounds, config=current_config)
|
return render_template('soundboard.html', sounds=sounds, config=current_config)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user