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

Should XLSXListField Support Nullable Values? #61

Closed
thomasmatecki opened this issue Apr 25, 2022 · 2 comments
Closed

Should XLSXListField Support Nullable Values? #61

thomasmatecki opened this issue Apr 25, 2022 · 2 comments

Comments

@thomasmatecki
Copy link

thomasmatecki commented Apr 25, 2022

Currently XLSXListField does not behave very nicely if prepping a value of None. This field corresponds to DRF's ListField, which does support allow_null=True.

    def prep_value(self) -> Any:
>       if len(self.value) > 0 and isinstance(self.value[0], Iterable):
E       TypeError: object of type 'NoneType' has no len()

It seems as though this field should nicely handle null (None) values. Happy to open a PR if folks agree.

@rptmat57
Copy link
Contributor

That sounds like a good idea to me. It should definitely handle None and return '' in that case.

@browniebroke
Copy link
Member

Fixed in #78

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

No branches or pull requests

4 participants