cleanup 2
This commit is contained in:
parent
79c8636ce1
commit
f8ee727705
22
app.py
22
app.py
@ -290,28 +290,6 @@ def check_habit():
|
|||||||
for tracking in trackings:
|
for tracking in trackings:
|
||||||
if tracking.created_at.date() == datetime.date.today():
|
if tracking.created_at.date() == datetime.date.today():
|
||||||
delete_tracking = tracking
|
delete_tracking = tracking
|
||||||
"""
|
|
||||||
# day
|
|
||||||
if habit.unit == 0:
|
|
||||||
if tracking.created_at.date() == datetime.date.today():
|
|
||||||
delete_tracking = tracking
|
|
||||||
break
|
|
||||||
# week
|
|
||||||
elif habit.unit == 1:
|
|
||||||
if tracking.created_at.date().isocalendar()[1] == datetime.date.today().isocalendar()[1]:
|
|
||||||
delete_tracking = tracking
|
|
||||||
break
|
|
||||||
# month
|
|
||||||
elif habit.unit == 2:
|
|
||||||
if tracking.created_at.date().month == datetime.date.today().month:
|
|
||||||
delete_tracking = tracking
|
|
||||||
break
|
|
||||||
# year
|
|
||||||
elif habit.unit == 3:
|
|
||||||
if tracking.created_at.date().year == datetime.date.today().year:
|
|
||||||
delete_tracking = tracking
|
|
||||||
break
|
|
||||||
"""
|
|
||||||
|
|
||||||
if not delete_tracking:
|
if not delete_tracking:
|
||||||
HabitTrackings.create(habit_id, 1)
|
HabitTrackings.create(habit_id, 1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user