Ensure workouts are printed in order of start date descending

This commit is contained in:
Peter Stockings
2022-12-07 20:56:12 +11:00
parent 14ecae99e4
commit dac5e99f05
2 changed files with 5 additions and 0 deletions

2
app.py
View File

@@ -299,6 +299,8 @@ def my_utility_processor():
return db.get_people_and_workout_count(person_id)
def get_first_element_from_list_with_matching_attribute(list, attribute, value):
if not list:
return None
for element in list:
if element[attribute] == value:
return element