Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_get_FIELD_display throws error if value is None #58

Open
twschiller opened this issue Dec 13, 2019 · 1 comment
Open

_get_FIELD_display throws error if value is None #58

twschiller opened this issue Dec 13, 2019 · 1 comment

Comments

@twschiller
Copy link
Contributor

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 added a commit to twschiller/django-enumfield that referenced this issue Dec 13, 2019
lundberg added a commit that referenced this issue Dec 16, 2019
@Mojken
Copy link

Mojken commented Nov 11, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants