fix: resolve template errors, orphaned sessions, and auth redirects

- Fix exercise_id undefined error in log_form.html by using scalar
  exercise_id instead of exercise.id object reference
- Clean up orphaned WorkoutSession records when all logs are deleted
- Filter empty sessions from dashboard stats (sessions, volume, streak)
- Replace broken HTTPException auth redirect with custom exception
  handler that properly returns 302 to /login

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 14:00:34 -06:00
parent 134542b66f
commit 215ce90404
6 changed files with 42 additions and 13 deletions

View File

@@ -38,6 +38,7 @@
{% set next_set = logs|length + 1 %}
{% include "partials/log_entry.html" %}
{% else %}
{% set exercise_id = exercise.id %}
{% set next_set = 1 %}
{% include "partials/log_form.html" %}
{% endif %}