fix(msgprint): let as_table work properly

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-12-23 17:30:03 +05:30
parent 4f0e303f18
commit a7cfb11e4b
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -69,12 +69,14 @@ def msgprint(
if sys.stdin and sys.stdin.isatty():
if out.as_list:
msg = [_strip_html_tags(msg) for msg in out.message]
out.message = [_strip_html_tags(cell) for cell in msg]
elif out.as_table:
out.message = [[_strip_html_tags(cell) for cell in row] for row in msg]
else:
msg = _strip_html_tags(out.message)
out.message = _strip_html_tags(msg)
if frappe.flags.print_messages and out.message:
print(f"Message: {_strip_html_tags(out.message)}")
print(f"Message: {out.message}")
out.title = title or _("Message", context="Default title of the message dialog")