diff options
| author | stilbruch <stilbruch@protonail.com> | 2022-05-09 17:57:02 -0500 |
|---|---|---|
| committer | stilbruch <stilbruch@protonail.com> | 2022-05-09 17:57:02 -0500 |
| commit | 9ba45476efa21791c2c69a083d90785a436435f7 (patch) | |
| tree | bff7e5d7abb152674e1f66bd2571474204a864a9 /app | |
| parent | d1f8adc797c3c6edd63b34d2da734783d9720138 (diff) | |
| download | Strengthy-9ba45476efa21791c2c69a083d90785a436435f7.tar.xz Strengthy-9ba45476efa21791c2c69a083d90785a436435f7.zip | |
Fix float lbs bug
Diffstat (limited to 'app')
| -rw-r--r-- | app/forms/workout.py | 5 | ||||
| -rw-r--r-- | app/routes/workout.py | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/forms/workout.py b/app/forms/workout.py index f3a1082..a06c771 100644 --- a/app/forms/workout.py +++ b/app/forms/workout.py @@ -4,6 +4,7 @@ from wtforms import ( FormField, HiddenField, IntegerField, + FloatField, SelectField, StringField, ) @@ -14,7 +15,7 @@ class ExerciseCreateForm(Form): id = HiddenField("id", [Optional()]) name = StringField("name", [DataRequired()]) sets = IntegerField("sets", [DataRequired()]) - units = IntegerField("units", [DataRequired()]) + units = FloatField("units", [DataRequired()]) type = SelectField( "type", [DataRequired()], choices=[("reps", "Reps"), ("time", "Time")] ) @@ -27,7 +28,7 @@ class WorkoutCreateForm(FlaskForm): # /workout/record class SetForm(Form): - lbs = IntegerField("lbs", [Optional()]) + lbs = FloatField("lbs", [Optional()]) units = IntegerField("units", [Optional()]) diff --git a/app/routes/workout.py b/app/routes/workout.py index e27cee8..767603e 100644 --- a/app/routes/workout.py +++ b/app/routes/workout.py @@ -131,6 +131,7 @@ def workout_record(workout_id=None): return redirect(url_for("home")) else: + print(form.errors) # Populate form with data for exercise in workout.exercises: form.exercises.append_entry( |
