Skip to content

Commit

Permalink
remove DefaultAlgorithmSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
myslak71 authored and myslak71 committed Feb 23, 2019
1 parent 28a0823 commit ceac034
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions duels/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ class Meta:
def to_representation(self, instance):
algorithm = super().to_representation(instance)
if self.context.get('include_algorithm_name'):
choice = dict(Algorithm._meta.get_field('name').choices)[algorithm['name']]
algorithm['name_display'] = choice
algorithm_name = dict(Algorithm._meta.get_field('name').choices)[algorithm['name']]
algorithm['name_display'] = algorithm_name
return algorithm


class DefaultAlgorithmSerializer(serializers.ModelSerializer):
class Meta:
model = DefaultAlgorithm
fields = ('__all__')
read_only_fields=('__all__')

0 comments on commit ceac034

Please sign in to comment.