Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Always set repetition and weight units

Roland Geider9e6990790538
diff --git a/wger/manager/migrations/0019_flexible_routines_migration.py b/wger/manager/migrations/0019_flexible_routines_migration.py
index b006ed9b0..19b79bc60 100644
--- a/wger/manager/migrations/0019_flexible_routines_migration.py
+++ b/wger/manager/migrations/0019_flexible_routines_migration.py
@@ -78,8 +78,12 @@ def migrate_routines(apps) -> dict[int, Any]:
slot_entry = SlotEntry(
slot=slot,
exercise=setting.exercise_base,
- repetition_unit=setting.repetition_unit,
- weight_unit=setting.weight_unit,
+
+ # default "reps"
+ repetition_unit_id=setting.repetition_unit_id if setting.repetition_unit_id is not None else 1,
+
+ # default "kg"
+ weight_unit_id=setting.weight_unit_id if setting.weight_unit_id is not None else 1,
order=setting.order,
comment=setting.comment,
)