From 41a03e9d3bbd2a7345a93b4ba6ded66af5a60d64 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 12 Jul 2020 13:23:45 +0300 Subject: [PATCH] Invitation: fix the checks making sure you can't invite yourself. --- django_etebase/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_etebase/serializers.py b/django_etebase/serializers.py index 908f126..7fe5050 100644 --- a/django_etebase/serializers.py +++ b/django_etebase/serializers.py @@ -294,7 +294,7 @@ class CollectionInvitationSerializer(serializers.ModelSerializer): def validate_user(self, value): request = self.context['request'] - if request.user == value.lower(): + if request.user.username == value.lower(): raise serializers.ValidationError('Inviting yourself is not allowed') return value