Skip to content

Commit d75fcbc

Browse files
santiavenda2mblayman
authored andcommitted
Avoid choices evaluation on relation fields getting field metadata (#336)
1 parent d8c3dc4 commit d75fcbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rest_framework_json_api/metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def get_field_info(self, field):
128128
field_info['children'] = self.get_serializer_info(field)
129129

130130
if (not field_info.get('read_only')
131-
and hasattr(field, 'choices')
132-
and not field_info.get('relationship_resource')):
131+
and not field_info.get('relationship_resource')
132+
and hasattr(field, 'choices')):
133133
field_info['choices'] = [
134134
{
135135
'value': choice_value,

0 commit comments

Comments
 (0)