Implementato ripristino ID counter a caricamento file
This commit is contained in:
2
app.py
2
app.py
@@ -12,7 +12,7 @@ def update_file():
|
|||||||
if os.path.isfile('compiti.json'):
|
if os.path.isfile('compiti.json'):
|
||||||
with open('compiti.json', 'r') as f:
|
with open('compiti.json', 'r') as f:
|
||||||
compiti = json.load(f)
|
compiti = json.load(f)
|
||||||
id_counter = 104
|
id_counter = compiti[-1]["id"] + 1
|
||||||
else:
|
else:
|
||||||
compiti = [
|
compiti = [
|
||||||
{"id": 1, "descrizione": "Compito matematica"},
|
{"id": 1, "descrizione": "Compito matematica"},
|
||||||
|
|||||||
Reference in New Issue
Block a user