You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_field_value will throw an error is the field is not hashable. e.g. for JSON field
Suggested fix:
defget_field_value(self, field):
"""Get the value of a field."""iffield.is_relation:
try:
returnstr(getattr(self.object, field.name))
exceptAttributeError:
returnNonetry:
# pylint: disable=protected-accessreturnself.object._get_FIELD_display(field)
exceptTypeError:
# for some reason this is not hashablefield_value=getattr(self.object, field.attname)
returnjson.dumps(field_value, cls=DjangoJSONEncoder)
The text was updated successfully, but these errors were encountered:
get_field_value will throw an error is the field is not hashable. e.g. for JSON field
Suggested fix:
The text was updated successfully, but these errors were encountered: