Fix redirect bug where no usb is inserted

This commit is contained in:
Ana Custura 2026-03-06 07:51:39 +00:00
parent 58de141c09
commit e0e63a747f

View file

@ -116,7 +116,7 @@ def index():
def files(path): def files(path):
base_path = app.config["BUTTERBOX_USB_PATH"] base_path = app.config["BUTTERBOX_USB_PATH"]
if not os.path.exists(base_path): if not os.path.exists(base_path):
flash(_('No USB inserted.')) return redirect(url_for('index'))
current_path = os.path.join(base_path, path) current_path = os.path.join(base_path, path)
render_files = [] render_files = []
if os.path.exists(current_path): if os.path.exists(current_path):