fix: avoid literal None
when rendering form field value
This commit is contained in:
parent
9580dde246
commit
f0d1f00dd8
|
@ -1033,12 +1033,13 @@ class Form:
|
|||
# render static text if field not in deform/schema
|
||||
# TODO: need to abstract this somehow
|
||||
if self.model_instance:
|
||||
html = str(self.model_instance[fieldname])
|
||||
value = self.model_instance[fieldname]
|
||||
html = str(value) if value is not None else ''
|
||||
else:
|
||||
html = ''
|
||||
|
||||
# mark all that as safe
|
||||
html = HTML.literal(html)
|
||||
html = HTML.literal(html or ' ')
|
||||
|
||||
# render field label
|
||||
label = self.get_label(fieldname)
|
||||
|
|
Loading…
Reference in a new issue