Fixed get_field_display method for None value.
This commit is contained in:
parent
009d6c1c52
commit
cbfe2ee9bd
|
@ -111,6 +111,7 @@ class MultiSelectField(models.CharField):
|
||||||
fieldname = name
|
fieldname = name
|
||||||
choicedict = dict(self.choices)
|
choicedict = dict(self.choices)
|
||||||
display = []
|
display = []
|
||||||
|
if getattr(obj, fieldname):
|
||||||
for value in getattr(obj, fieldname):
|
for value in getattr(obj, fieldname):
|
||||||
item_display = choicedict.get(value, None)
|
item_display = choicedict.get(value, None)
|
||||||
if item_display is None:
|
if item_display is None:
|
||||||
|
|
Loading…
Reference in a new issue