From a5e50e5de6a3d9434878a22566e77f9f8378a111 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <yohann.danello@gmail.com>
Date: Thu, 30 Jul 2020 16:48:34 +0200
Subject: [PATCH] Display true note name next to the alias, whenever the user
 has low permissions

---
 apps/note/api/serializers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/note/api/serializers.py b/apps/note/api/serializers.py
index c6681ee7..bcf0bdf5 100644
--- a/apps/note/api/serializers.py
+++ b/apps/note/api/serializers.py
@@ -119,7 +119,7 @@ class ConsumerSerializer(serializers.ModelSerializer):
         # If the user has no right to see the note, then we only display the note identifier
         if PermissionBackend.check_perm(get_current_authenticated_user(), "note.view_note", obj.note):
             return NotePolymorphicSerializer().to_representation(obj.note)
-        return dict(id=obj.note.id)
+        return dict(id=obj.note.id, name=str(obj.note))
 
     def get_email_confirmed(self, obj):
         if isinstance(obj.note, NoteUser):
-- 
GitLab