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:
delete_tracking.delete()
# Update habit
habit.fill_statistics()
return {
"habitId": habit_id,
"unchecked": not delete_tracking

View File

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