New frontpage format

This commit is contained in:
2024-04-14 22:10:07 +02:00
parent 3ca1a1a8bd
commit 4dee6d33e9
2 changed files with 304 additions and 251 deletions

9
app.py
View File

@@ -34,6 +34,7 @@ def index():
if request.method == 'POST':
set_num = request.form.get('set_num')
index = request.form.get('index')
minif = request.form.get('minif')
scheck = request.form.get('scheck')
scol = request.form.get('scol')
@@ -41,12 +42,12 @@ def index():
with open('./info/'+set_num+'.json') as info:
json_file = json.loads(info.read())
if minif != None:
json_file['Minifigs Collected'] = minif
json_file['unit'][int(index)]['Minifigs Collected'] = minif
if scheck != None:
json_file['Set Checked'] = scheck
json_file['unit'][int(index)]['Set Checked'] = scheck
if scol != None:
json_file['Set Collected'] = scol
json_file['unit'][int(index)]['Set Collected'] = scol
with open('./info/'+set_num+'.json', 'w') as dump_file:
json.dump(json_file,dump_file)
return ('', 204)