Fix CRUD pages for tempmon clients, probes

for some reason if helptext had embedded newlines, it would now fail
to render the form altogether.  guess that is a result of recent
change to e.g. `<b-field :message="['foo', 'bar']">` logic,
somehow.. anyway hopefully this fixes and no more surprises
This commit is contained in:
Lance Edgar 2023-10-05 13:11:05 -05:00
parent 3dfab8e42d
commit b30f6cdf3a
4 changed files with 31 additions and 47 deletions

View file

@ -755,7 +755,8 @@ class Form(object):
"""
Set the help text for a given field.
"""
self.helptext[key] = value
# nb. must avoid newlines, they cause some weird "blank page" error?!
self.helptext[key] = value.replace('\n', ' ')
if value and dynamic:
self.dynamic_helptext[key] = True
else:
@ -1009,6 +1010,8 @@ class Form(object):
# render the field widget or whatever
if self.readonly or fieldname in self.readonly_fields:
html = self.render_field_value(fieldname) or HTML.tag('span')
if type(html) is str:
html = HTML.tag('span', c=[html])
elif field:
html = field.serialize(**self.get_renderer_kwargs(fieldname))
html = HTML.literal(html)