From 2021ad55e4af8520e617fab274d07ab1e19a7354 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Wed, 20 Nov 2024 22:19:15 +0100 Subject: [PATCH] Removed minifig checkbox if set doesn't contain any --- app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index c5699f0..2eb08c5 100644 --- a/app.py +++ b/app.py @@ -530,6 +530,9 @@ def index(): except Exception as e: print(e) + cursor.execute('select distinct set_num from minifigures;') + results = cursor.fetchall() + minifigs = [list(i)[0] for i in results] cursor.close() conn.close() @@ -539,7 +542,7 @@ def index(): #files = [re.match(r'^([\w]+-[\w]+)', f).group() for f in os.listdir(DIRECTORY) if f.endswith('.pdf')] print(files.sort()) - return render_template('index.html',set_list=set_list,themes_list=theme_file,missing_list=missing_list,files=files) + return render_template('index.html',set_list=set_list,themes_list=theme_file,missing_list=missing_list,files=files,minifigs=minifigs) if request.method == 'POST': set_num = request.form.get('set_num')