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:
@@ -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 %}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!-- Inline logging form, included inside each exercise_card.html -->
|
||||
<form hx-post="/log"
|
||||
hx-target="#logs-exercise-{{ exercise.id }}"
|
||||
hx-target="#logs-exercise-{{ exercise_id }}"
|
||||
hx-swap="innerHTML"
|
||||
style="margin-bottom:0;">
|
||||
<input type="hidden" name="exercise_id" value="{{ exercise.id }}">
|
||||
<input type="hidden" name="exercise_id" value="{{ exercise_id }}">
|
||||
<input type="hidden" name="workout_day_id" value="{{ workout_day_id }}">
|
||||
<input type="hidden" name="set_number" value="{{ next_set|default(1) }}">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user