Skip to content

Commit

Permalink
Fix bug in DFMS (indexing with key that may not exist)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gresh committed Aug 5, 2023
1 parent fd63e13 commit b935d94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
super(DynamicFieldsModelSerializer, self).__init__(*args, **kwargs)

# The request doesn't exist when generating an OAS file, so we have to check that first
if self.context['request']:
if 'request' in self.context:
fields = self.context['request'].query_params.get('fields')
if fields:
fields = fields.split(',')
Expand Down Expand Up @@ -280,7 +280,7 @@ class Meta:
'document__url'
)

class SubraceSerializer(DynamicFieldsHyperlinkedModelSerializer):
class SubraceSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.Subrace
fields = ('name',
Expand Down

0 comments on commit b935d94

Please sign in to comment.