Don't list M2M choices in OPTIONS requests. Refs #3751. (#4160)

This commit is contained in:
Tom Christie 2016-06-01 17:28:32 +01:00
parent 014e24b024
commit 05b0c2adff

View File

@ -138,7 +138,7 @@ class SimpleMetadata(BaseMetadata):
field_info['children'] = self.get_serializer_info(field) field_info['children'] = self.get_serializer_info(field)
if (not field_info.get('read_only') and if (not field_info.get('read_only') and
not isinstance(field, serializers.RelatedField) and not isinstance(field, (serializers.RelatedField, serializers.ManyRelatedField)) and
hasattr(field, 'choices')): hasattr(field, 'choices')):
field_info['choices'] = [ field_info['choices'] = [
{ {