From 62146881703a0c493f82367ac065395919e5b468 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 29 Sep 2020 14:56:29 +0300 Subject: [PATCH] Invitations: share the username of the inviter. --- django_etebase/serializers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django_etebase/serializers.py b/django_etebase/serializers.py index 4518f58..4798f97 100644 --- a/django_etebase/serializers.py +++ b/django_etebase/serializers.py @@ -351,12 +351,14 @@ class CollectionInvitationSerializer(BetterErrorsMixin, serializers.ModelSeriali style={'base_template': 'input.html'}, ) collection = serializers.CharField(source='collection.uid') + fromUsername = BinaryBase64Field(source='fromMember.user.username', read_only=True) fromPubkey = BinaryBase64Field(source='fromMember.user.userinfo.pubkey', read_only=True) signedEncryptionKey = BinaryBase64Field() class Meta: model = models.CollectionInvitation - fields = ('username', 'uid', 'collection', 'signedEncryptionKey', 'accessLevel', 'fromPubkey', 'version') + fields = ('username', 'uid', 'collection', 'signedEncryptionKey', 'accessLevel', + 'fromUsername', 'fromPubkey', 'version') def validate_user(self, value): request = self.context['request']