Public Access
fix: cast qty/unit to str before html.escape in vote email shopping preview
Recipe ingredient qty fields in JSONB are stored as floats (e.g. 1.5), not strings. html.escape() requires str input — AttributeError otherwise. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -170,9 +170,9 @@ def step_email(run: "WeeklyRun", db: "Session") -> None:
|
|||||||
if all_ingredients:
|
if all_ingredients:
|
||||||
shop_rows = "".join(
|
shop_rows = "".join(
|
||||||
f"<tr><td style='padding:4px 8px'>{html.escape(name)}</td>"
|
f"<tr><td style='padding:4px 8px'>{html.escape(name)}</td>"
|
||||||
f"<td style='padding:4px 8px;color:#555'>{html.escape(qty)} {html.escape(unit)}</td>"
|
f"<td style='padding:4px 8px;color:#555'>{html.escape(str(qty))} {html.escape(str(unit))}</td>"
|
||||||
f"<td style='padding:4px 8px;color:#555'>{html.escape(grocery)}</td>"
|
f"<td style='padding:4px 8px;color:#555'>{html.escape(str(grocery))}</td>"
|
||||||
f"<td style='padding:4px 8px;font-weight:bold'>{html.escape(price)}</td></tr>"
|
f"<td style='padding:4px 8px;font-weight:bold'>{html.escape(str(price))}</td></tr>"
|
||||||
for name, (qty, unit, grocery, price) in all_ingredients.items()
|
for name, (qty, unit, grocery, price) in all_ingredients.items()
|
||||||
)
|
)
|
||||||
shopping_preview = (
|
shopping_preview = (
|
||||||
|
|||||||
Reference in New Issue
Block a user