mirror of
https://github.com/etesync/server
synced 2024-12-27 09:48:24 +00:00
Invitation: fix the checks making sure you can't invite yourself.
This commit is contained in:
parent
9f1bfceda7
commit
41a03e9d3b
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user