Always return choices even if empty list.

This commit is contained in:
Chris Church 2015-05-13 13:44:53 -04:00
parent af67ac6931
commit 55c41252f8

View File

@ -120,8 +120,7 @@ class ChoiceField(fields.ChoiceField):
def metadata(self):
metadata = super(ChoiceField, self).metadata()
if self.choices:
metadata['choices'] = self.choices
metadata['choices'] = self.choices or []
return metadata
# Monkeypatch REST framework to replace default ChoiceField used by