From 3215ae174423772e4643e4a145b49f301e8798ab Mon Sep 17 00:00:00 2001 From: LukeVader Date: Wed, 9 Jul 2025 10:36:45 +0200 Subject: [PATCH] Test patch for shared used collection adventures --- backend/server/adventures/serializers.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/backend/server/adventures/serializers.py b/backend/server/adventures/serializers.py index 3023e04..28e8c62 100644 --- a/backend/server/adventures/serializers.py +++ b/backend/server/adventures/serializers.py @@ -122,16 +122,6 @@ class AdventureSerializer(CustomModelSerializer): return [image for image in serializer.data if image is not None] def validate_collections(self, collections): - """Validate that collections belong to the same user""" - if not collections: - return collections - - user = self.context['request'].user - for collection in collections: - if collection.user_id != user: - raise serializers.ValidationError( - f"Collection '{collection.name}' does not belong to the current user." - ) return collections def validate_category(self, category_data): @@ -409,4 +399,4 @@ class CollectionSerializer(CustomModelSerializer): for user in instance.shared_with.all(): shared_uuids.append(str(user.uuid)) representation['shared_with'] = shared_uuids - return representation \ No newline at end of file + return representation