Improved handling of empty values
This commit is contained in:
parent
e8c9650f19
commit
c7daa84610
|
@ -119,7 +119,9 @@ class MultiSelectField(models.CharField):
|
||||||
item_display = choicedict.get(int(value), value)
|
item_display = choicedict.get(int(value), value)
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
item_display = value
|
item_display = value
|
||||||
display.append(string_type(item_display))
|
item_display = string_type(item_display)
|
||||||
|
if item_display not in ('', u'', None):
|
||||||
|
display.append(item_display)
|
||||||
return display
|
return display
|
||||||
def get_display(obj):
|
def get_display(obj):
|
||||||
return ", ".join(get_list(obj))
|
return ", ".join(get_list(obj))
|
||||||
|
|
Loading…
Reference in a new issue