Embed achievement badges in exercise progress graphs
This commit is contained in:
8
db.py
8
db.py
@@ -427,6 +427,11 @@ class DataBase():
|
||||
start_dates = [t['start_date'] for t in topsets]
|
||||
messages = [f'{t["repetitions"]} x {t["weight"]}kg ({t["estimated_1rm"]}kg E1RM) on {t["start_date"].strftime("%d %b %y")}' for t in topsets]
|
||||
|
||||
# Get the latest topset info for badges
|
||||
latest_topset = topsets[-1]
|
||||
latest_topset_id = latest_topset['topset_id']
|
||||
latest_workout_id = latest_topset['workout_id']
|
||||
|
||||
exercise_progress = get_exercise_graph_model(
|
||||
exercise_name,
|
||||
estimated_1rm,
|
||||
@@ -440,6 +445,9 @@ class DataBase():
|
||||
min_date,
|
||||
max_date,
|
||||
degree)
|
||||
|
||||
exercise_progress['latest_topset_id'] = latest_topset_id
|
||||
exercise_progress['latest_workout_id'] = latest_workout_id
|
||||
|
||||
return exercise_progress
|
||||
|
||||
|
||||
Reference in New Issue
Block a user