Rolled back code
This commit is contained in:
parent
428e2498dd
commit
27fbebca98
28
app.py
28
app.py
@ -126,8 +126,9 @@ def index():
|
||||
habits = []
|
||||
name = "Bitte melde dich an."
|
||||
|
||||
# old code
|
||||
"""trackings = habit.get_habitTrackings()
|
||||
# Add checked attribute to habits (if they have been checked today)
|
||||
for habit in habits:
|
||||
trackings = habit.get_habitTrackings()
|
||||
for tracking in trackings:
|
||||
# day
|
||||
if habit.unit == 0:
|
||||
@ -150,16 +151,6 @@ def index():
|
||||
habit.checked = True
|
||||
break
|
||||
|
||||
else:
|
||||
habit.checked = False"""
|
||||
|
||||
# Add checked attribute to habits (if they have been checked today)
|
||||
for habit in habits:
|
||||
trackings = habit.get_habitTrackings()
|
||||
for tracking in trackings:
|
||||
if tracking.created_at.date() == datetime.date.today():
|
||||
habit.checked = True
|
||||
break
|
||||
else:
|
||||
habit.checked = False
|
||||
|
||||
@ -333,7 +324,7 @@ def check_habit():
|
||||
trackings = habit.get_habitTrackings()
|
||||
|
||||
# Check if habit has been tracked today
|
||||
"""delete_tracking = None
|
||||
delete_tracking = None
|
||||
for tracking in trackings:
|
||||
# day
|
||||
if habit.unit == 0:
|
||||
@ -356,17 +347,6 @@ def check_habit():
|
||||
delete_tracking = tracking
|
||||
break
|
||||
|
||||
if not delete_tracking:
|
||||
HabitTrackings.create(habit_id, 1)
|
||||
else:
|
||||
delete_tracking.delete()"""
|
||||
|
||||
delete_tracking = None
|
||||
for tracking in trackings:
|
||||
if tracking.created_at.date() == datetime.date.today():
|
||||
delete_tracking = tracking
|
||||
break
|
||||
|
||||
if not delete_tracking:
|
||||
HabitTrackings.create(habit_id, 1)
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user