django-enumfield icon indicating copy to clipboard operation
django-enumfield copied to clipboard

_get_FIELD_display throws error if value is None

Open twschiller opened this issue 6 years ago • 1 comments

In the 2.0 release, _get_FIELD_display throws an error if the value is None. I think the code needs to be changed to:

def _get_FIELD_display(self, cls):
    value = getattr(cls, self.attname)
    if value is None:
         return value
    return force_text(value.label, strings_only=True)

twschiller avatar Dec 13 '19 14:12 twschiller

This was resolved, right? Why is the issue still open?

Mojken avatar Nov 11 '21 10:11 Mojken