fix milestone deletion
This commit is contained in:
parent
7e408c1b74
commit
423f12ed34
|
@ -90,13 +90,12 @@ def refresh_milestones():
|
||||||
to_delete = []
|
to_delete = []
|
||||||
for milestone in milestones:
|
for milestone in milestones:
|
||||||
milestone = milestone[0]
|
milestone = milestone[0]
|
||||||
print(f"Checking milestone {milestone}")
|
if milestone not in current_app.config['REDEEMS'].keys():
|
||||||
if milestone not in current_app.config['REDEEMS'].items():
|
|
||||||
to_delete.append(milestone)
|
to_delete.append(milestone)
|
||||||
elif current_app.config['REDEEMS'][milestone]['type'] != "milestone":
|
elif current_app.config['REDEEMS'][milestone]['type'] != "milestone":
|
||||||
to_delete.append(milestone)
|
to_delete.append(milestone)
|
||||||
for milestone in to_delete:
|
for milestone in to_delete:
|
||||||
cursor.execute("DELETE FROM counters WHERE name = ?", (milestone,))
|
cursor.execute("DELETE FROM milestones WHERE name = ?", (milestone,))
|
||||||
db.commit()
|
db.commit()
|
||||||
except sqlite3.Error as e:
|
except sqlite3.Error as e:
|
||||||
print("Failed deleting old milestones from db:", e.args[0])
|
print("Failed deleting old milestones from db:", e.args[0])
|
||||||
|
|
Loading…
Reference in New Issue