mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 12:59:36 +02:00
feat: Convert activity input to lowercase for consistency
This commit is contained in:
parent
c723d2836d
commit
5e70130000
4 changed files with 44 additions and 18 deletions
|
@ -18,6 +18,11 @@ class AdventureSerializer(serializers.ModelSerializer):
|
|||
representation['image'] = f"{public_url}/media/{instance.image.name}"
|
||||
return representation
|
||||
|
||||
def validate_activity_types(self, value):
|
||||
if value:
|
||||
return [activity.lower() for activity in value]
|
||||
return value
|
||||
|
||||
class CollectionSerializer(serializers.ModelSerializer):
|
||||
adventures = AdventureSerializer(many=True, read_only=True, source='adventure_set')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue