mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-04 20:55:19 +02:00
Merge branch 'seanmorley15:main' into main
This commit is contained in:
commit
2ee4b2a4d4
1 changed files with 1 additions and 1 deletions
|
@ -128,7 +128,7 @@ class AdventureSerializer(CustomModelSerializer):
|
|||
|
||||
user = self.context['request'].user
|
||||
for collection in collections:
|
||||
if collection.user_id != user:
|
||||
if collection.user_id != user and not collection.shared_with.filter(id=user.id).exists():
|
||||
raise serializers.ValidationError(
|
||||
f"Collection '{collection.name}' does not belong to the current user."
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue