1
0
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:
Tom Hacohen 2020-07-12 13:23:45 +03:00
parent 9f1bfceda7
commit 41a03e9d3b

View File

@ -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