diff --git a/project/accounts/serializers.py b/project/accounts/serializers.py index 2d990c4..e0f27bd 100644 --- a/project/accounts/serializers.py +++ b/project/accounts/serializers.py @@ -5,9 +5,9 @@ from notes.models import Note class CustomUserSerializer(serializers.ModelSerializer): notes = serializers.PrimaryKeyRelatedField( - many=True, allow_null=True, queryset=Note.objects.all()) + many=True, allow_null=True, read_only=True) class Meta: model = User - fields = ['id', 'username', 'notes',] + fields = ['id', 'username', 'notes'] read_only_fields = ['id', 'notes']