Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix string representation for variations

Roland Geider0177b0e61c31
diff --git a/wger/exercises/models.py b/wger/exercises/models.py
index 1c787e992..01769c222 100644
--- a/wger/exercises/models.py
+++ b/wger/exercises/models.py
@@ -162,7 +162,7 @@ class Variation(models.Model):
"""
Return a more human-readable representation
"""
- return self.name
+ return f'Variation {self.id}'
def get_owner_object(self):
"""
@@ -170,9 +170,6 @@ class Variation(models.Model):
"""
return False
- def get_variation(self):
- return f'Variation {self.id}'
-
class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
"""
@@ -240,7 +237,7 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
null=True,
default=""
)
- "Variations of this exercise"
+ """Variations of this exercise"""
#
# Django methods
@@ -301,6 +298,10 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
@property
def get_variations(self):
+ """
+ Returns the variations for this exercise
+ """
+
return self.variations.exercise_set.exclude(id=self.id)
@property