Skip to content

Commit

Permalink
Merge pull request #23 from spanishpy/fix-to-representation-for-choic…
Browse files Browse the repository at this point in the history
…efield

Fix to_representation when using ChoiceField.
  • Loading branch information
em1208 authored Jan 3, 2024
2 parents 6541ed7 + c966754 commit 946e9d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions adrf/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,9 @@ async def ato_representation(self, instance):
except SkipField:
continue

is_drf_field = (
type(field)
in DRFModelSerializer.serializer_field_mapping.values()
)
is_drf_field = type(field) in list(
DRFModelSerializer.serializer_field_mapping.values()
) + [DRFModelSerializer.serializer_choice_field]

check_for_none = (
attribute.pk
Expand Down

0 comments on commit 946e9d9

Please sign in to comment.