1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Fix devalidation

This commit is contained in:
Yohann D'ANELLO
2020-04-10 00:09:10 +02:00
parent 751147f254
commit 6477590cd4
2 changed files with 5 additions and 1 deletions

View File

@ -111,6 +111,10 @@ class ConsumerSerializer(serializers.ModelSerializer):
fields = '__all__'
def get_note(self, obj):
"""
Display information about the associated note
"""
# 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):
print(obj.pk)
return NotePolymorphicSerializer().to_representation(obj.note)