Fixed small bug and refreshed percentages

This commit is contained in:
Verox001 2024-01-30 10:37:38 +01:00
parent 51f263061f
commit 45971b4bdf
2 changed files with 4 additions and 1 deletions

3
app.py
View File

@ -324,6 +324,9 @@ def check_habit():
else: else:
delete_tracking.delete() delete_tracking.delete()
# Update habit
habit.fill_statistics()
return { return {
"habitId": habit_id, "habitId": habit_id,
"unchecked": not delete_tracking "unchecked": not delete_tracking

View File

@ -93,7 +93,7 @@ class Habit:
count += 1 count += 1
# month # month
elif self.unit == 2: elif self.unit == 2:
if tracking.created_at.date().month == datetime.today().month: if tracking.created_at.month == datetime.today().month:
self.checked = True self.checked = True
count += 1 count += 1
# year # year