From a38c31ca876e2067662dfa83b96d7286c39bd278 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 27 Oct 2025 11:27:59 +0000 Subject: [PATCH] Fix template path for question review block and remove unnecessary form wrapper to prevent nested forms --- generic/views.py | 2 +- sbas/templates/sbas/question_review_question.html | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/generic/views.py b/generic/views.py index 9d934331..4124abfe 100644 --- a/generic/views.py +++ b/generic/views.py @@ -3007,7 +3007,7 @@ class GenericViewBase: # Default: render the block (latest if exists, otherwise form) if latest: - return render(request, "/generic/partials/question_review_block.html", {"review": latest, "question": question, "app_name": self.app_name}) + return render(request, "generic/partials/question_review_block.html", {"review": latest, "question": question, "app_name": self.app_name}) else: # Ensure a form is available for the template if latest: diff --git a/sbas/templates/sbas/question_review_question.html b/sbas/templates/sbas/question_review_question.html index f98d1aea..c55ebfe5 100644 --- a/sbas/templates/sbas/question_review_question.html +++ b/sbas/templates/sbas/question_review_question.html @@ -114,8 +114,12 @@ {% comment %} Add Review {% endcomment %} -
- {% include 'generic/partials/question_review_form.html' with app_name='sbas' question=question form=form %} -
+ {% comment %} The included partial contains its own
with hx-post. Do not wrap it in another form (nested forms break submission). {% endcomment %} + {% include 'generic/partials/question_review_form.html' with app_name='sbas' question=question form=form %} + +
+ {# Placeholder while HTMX fetches review/block #} +
+ {% endblock %} \ No newline at end of file