Skip to content

Commit

Permalink
Merge pull request #507 from open5e/staging
Browse files Browse the repository at this point in the history
Release 1.6.1
  • Loading branch information
augustjohnson committed Aug 6, 2024
2 parents 2bad62d + dea9012 commit 5b12f5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 10 additions & 10 deletions api_v2/serializers/creature.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ def make_action_obj(action):
return obj


class CreatureTypeSerializer(GameContentSerializer):
'''Serializer for the Creature Type object'''
key = serializers.ReadOnlyField()

class Meta:
'''Meta options for serializer.'''
model = models.CreatureType
fields = '__all__'


class CreatureSerializer(GameContentSerializer):
'''The serializer for the Creature object.'''

Expand All @@ -108,7 +118,6 @@ class CreatureSerializer(GameContentSerializer):
skill_bonuses = serializers.SerializerMethodField()
skill_bonuses_all = serializers.SerializerMethodField()
actions = serializers.SerializerMethodField()
size = SizeSerializer(read_only=True, context={'request': {}})
speed = serializers.SerializerMethodField()
speed_all = serializers.SerializerMethodField()
challenge_rating_text = serializers.SerializerMethodField()
Expand Down Expand Up @@ -230,15 +239,6 @@ def get_challenge_rating_text(self, creature):
def get_experience_points(self, creature):
return creature.experience_points

class CreatureTypeSerializer(GameContentSerializer):
'''Serializer for the Creature Type object'''
key = serializers.ReadOnlyField()

class Meta:
'''Meta options for serializer.'''
model = models.CreatureType
fields = '__all__'


class CreatureSetSerializer(GameContentSerializer):
'''Serializer for the Creature Set object'''
Expand Down
4 changes: 0 additions & 4 deletions api_v2/serializers/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ class Meta:
class ItemSerializer(GameContentSerializer):
key = serializers.ReadOnlyField()
is_magic_item = serializers.ReadOnlyField()
weapon = WeaponSerializer(read_only=True, context={'request': {}})
size = SizeSerializer(read_only=True, context={'request': {}})
armor = ArmorSerializer(read_only=True, context={'request': {}})
rarity = ItemRaritySerializer(read_only=True, context={'request': {}})

class Meta:
model = models.Item
Expand Down

0 comments on commit 5b12f5a

Please sign in to comment.