Skip to content

Commit 5cf3531

Browse files
peterusclaude
andcommitted
fix: multiline template comment and double JSON encoding in queue form
Django {# #} comments don't support multiple lines, causing raw template text to appear in forms. The queue view double-encoded the printer map (json.dumps + json_script), hiding all printer options in the dropdown. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cd7953e commit 5cf3531

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

core/templates/core/includes/_form_field.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{% load core_tags %}
2-
{# Generic form field renderer.
3-
Context: field — a bound Django form field.
4-
#}
2+
{% comment %}Generic form field renderer. Context: field — a bound Django form field.{% endcomment %}
53
{% with widget_type=field|widget_class %}
64
{% if 'HiddenInput' in widget_type %}
75
{{ field }}

core/views/queue.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ def get_form(self, form_class=None):
9393

9494
def get_context_data(self, **kwargs):
9595
"""Add plate->compatible-printers mapping for client-side filtering."""
96-
import json as _json
97-
9896
context = super().get_context_data(**kwargs)
9997

10098
# Build a map: plate_pk -> [compatible printer PKs]
@@ -118,7 +116,7 @@ def get_context_data(self, **kwargs):
118116
compatible = [p.pk for p in printers]
119117
plate_printer_map[str(plate.pk)] = compatible
120118

121-
context["job_printer_map_json"] = _json.dumps(plate_printer_map)
119+
context["job_printer_map_json"] = plate_printer_map
122120
return context
123121

124122
def form_valid(self, form):

0 commit comments

Comments
 (0)