Skip to content

_get_FIELD_display throws error if value is None #58

@twschiller

Description

@twschiller

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions