summaryrefslogtreecommitdiff
path: root/app/routes
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-05-11 15:19:43 -0500
committerstilbruch <stilbruch@protonmail.com>2022-05-11 15:19:43 -0500
commitd73b73e8ec1fbfadadc7500f99e5a89bda545652 (patch)
treef6b040aa850ae8dc837e254b881e84c0e62b66fa /app/routes
parent141b8cf1e4a867e4b52506b950b46cac2ea27984 (diff)
parent98c1eb525e0768aa69ac598565dd0d8d2975e65a (diff)
downloadStrengthy-d73b73e8ec1fbfadadc7500f99e5a89bda545652.tar.xz
Strengthy-d73b73e8ec1fbfadadc7500f99e5a89bda545652.zip
Merge branch 'master' of stilbruch.xyz:strengthy
Diffstat (limited to 'app/routes')
-rw-r--r--app/routes/api.py2
-rw-r--r--app/routes/basic.py2
-rw-r--r--app/routes/workout.py1
3 files changed, 4 insertions, 1 deletions
diff --git a/app/routes/api.py b/app/routes/api.py
index 77c8650..097400d 100644
--- a/app/routes/api.py
+++ b/app/routes/api.py
@@ -1,5 +1,5 @@
from app import app, db
-from flask import redirect, request, jsonify
+from flask import redirect, request, jsonify, url_for
from flask_login import current_user, login_required
from tables import Exercise, SetRecord, Workout, WorkoutRecord
diff --git a/app/routes/basic.py b/app/routes/basic.py
index b211da7..584d837 100644
--- a/app/routes/basic.py
+++ b/app/routes/basic.py
@@ -17,6 +17,7 @@ def home():
db.session.query(WorkoutRecord)
.filter_by(user_id=current_user.id)
.order_by(WorkoutRecord.finished.desc())
+ .all()
)
# Set records length
@@ -36,6 +37,7 @@ def home():
.filter(SetRecord.exercise_id == Exercise.id)
.group_by(Exercise.id)
.order_by(db.func.count(SetRecord.id).desc())
+ .having(db.func.count(SetRecord.id) > 1)
.limit(3)
.all()
)
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(