Skip to content

Commit

Permalink
logic adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhegarty committed Feb 13, 2024
1 parent 316c70c commit 80b3c61
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions import_export/widgets.py
Expand Up @@ -87,10 +87,12 @@ def is_empty(self, value):

def render(self, value, obj=None):
self._obj_deprecation_warning(obj)
if not isinstance(value, numbers.Number):
return ""
if self.coerce_to_string:
return "" if value is None else number_format(value)
return (
""
if value is None or not isinstance(value, numbers.Number)
else number_format(value)
)
return value


Expand Down

0 comments on commit 80b3c61

Please sign in to comment.