Skip to content

Commit 8dbc009

Browse files
committed
Remove trailing comma from the text representation
1 parent 49bbd18 commit 8dbc009

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

manage.py

100644100755
File mode changed.

wger/manager/dataclasses.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def round_value(x: int | float, base: float = 5) -> Decimal:
135135
rir = round_value(self.rir, 0.5)
136136
out.append(f'@ {rir} {_("RiR")}')
137137

138-
return ' '.join(out)
138+
return ' '.join(out).strip(',')
139139

140140

141141
@dataclass

wger/manager/tests/test_set_config_data.py

+9
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ def test_text_repr_sets_and_weight_range(self):
104104
self.config.max_weight = 30
105105
self.assertEqual(self.config.text_repr, '3 Sets, 4 × 20-30 kg @ 3 RiR')
106106

107+
def test_text_repr_only_sets(self):
108+
self.config.sets = 3
109+
self.config.weight = None
110+
self.config.max_weight = None
111+
self.config.max_reps = None
112+
self.config.reps = None
113+
self.config.rir = None
114+
self.assertEqual(self.config.text_repr, '3 Sets')
115+
107116
def test_rpe_calculation(self):
108117
self.assertEqual(self.config.rpe, 7)
109118

0 commit comments

Comments
 (0)