fix: avoid error when form value cannot be obtained

This commit is contained in:
Lance Edgar 2024-08-28 14:20:17 -05:00
parent 71d63f6b93
commit bc399182ba

View file

@ -1380,7 +1380,11 @@ class Form(object):
return getattr(record, field_name)
except AttributeError:
pass
try:
return record[field_name]
except TypeError:
pass
# TODO: is this always safe to do?
elif self.defaults and field_name in self.defaults: