Skip to content

Fix(manager) : Make weight and rep units mandatory #2203#2275

Open
pankaj-basnet wants to merge 5 commits intowger-project:masterfrom
pankaj-basnet:fix/2203-mandatory-units
Open

Fix(manager) : Make weight and rep units mandatory #2203#2275
pankaj-basnet wants to merge 5 commits intowger-project:masterfrom
pankaj-basnet:fix/2203-mandatory-units

Conversation

@pankaj-basnet
Copy link
Copy Markdown
Contributor

  • This PR addresses issue Make weight and rep units mandatory #2203 by enforcing mandatory units for weight and repetitions across the manager app. By removing nullability from these fields, we simplify the client-side logic (Flutter/React) and ensure consistent data integrity across the platform.
  • Makes weight_unit and repetition_unit non-nullable in SlotEntry and WorkoutLog.

Proposed Changes

  • Removed null=True, blank=True from repetition_unit and weight_unit in models code files
  • Removed allow_null=True from SetConfigDataSerializer unit fields
  • Migrations:
    • 0024: Data migration to backfill all existing NULL units to default values (ID 1).
    • 0025: Manual schema migration to enforce NOT NULL constraints.

Related Issue(s)

Fixes #2203.

NOTE: Todo tasks for react/flutter remaining.

…ry and WorkoutLog

This migration ensures that legacy workout data is compatible with new unit-aware calculation logic. It defaults missing units to ID 1 (KG/Repetitions)
…nd WorkoutLog tables)

- data migration to backfill null units with defaults already done.
- Update SlotEntry and WorkoutLog models to non-nullable ForeignKeys.
…n units in SlotEntry and Log tables wger-project#2203

Enforce mandatory units in Log and SlotEntry models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make weight and rep units mandatory

1 participant