From b63fa1964482bf1b156e35a412a1ac73a9ed23f0 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 6 Sep 2020 09:10:57 +0200 Subject: [PATCH] With normal rights, notes were displayed as there were inactive --- apps/note/api/serializers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/note/api/serializers.py b/apps/note/api/serializers.py index a9c2a107..0f2a2d72 100644 --- a/apps/note/api/serializers.py +++ b/apps/note/api/serializers.py @@ -127,7 +127,12 @@ class ConsumerSerializer(serializers.ModelSerializer): # If the user has no right to see the note, then we only display the note identifier return NotePolymorphicSerializer().to_representation(obj.note)\ if PermissionBackend.check_perm(get_current_authenticated_user(), "note.view_note", obj.note)\ - else dict(id=obj.note.id, name=str(obj.note)) + else dict( + id=obj.note.id, + name=str(obj.note), + is_active=obj.note.is_active, + display_image=obj.note.display_image.url, + ) def get_email_confirmed(self, obj): if isinstance(obj.note, NoteUser):