mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 12:59:36 +02:00
Security improvments
This commit is contained in:
parent
8453be8003
commit
3b002c0c50
4 changed files with 20 additions and 16 deletions
|
@ -7,6 +7,7 @@ class AdventureSerializer(serializers.ModelSerializer):
|
|||
class Meta:
|
||||
model = Adventure
|
||||
fields = '__all__'
|
||||
read_only_fields = ['id', 'created_at', 'updated_at', 'user_id']
|
||||
|
||||
def to_representation(self, instance):
|
||||
representation = super().to_representation(instance)
|
||||
|
@ -205,4 +206,4 @@ class CollectionSerializer(serializers.ModelSerializer):
|
|||
model = Collection
|
||||
# fields are all plus the adventures field
|
||||
fields = ['id', 'description', 'user_id', 'name', 'is_public', 'adventures', 'created_at', 'start_date', 'end_date', 'transportations', 'notes', 'updated_at', 'checklists']
|
||||
read_only_fields = ['id', 'created_at', 'updated_at']
|
||||
read_only_fields = ['id', 'created_at', 'updated_at', 'user_id']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue