Alias pk != Note pk

This commit is contained in:
Yohann D'ANELLO 2020-07-29 17:50:14 +02:00
parent 4549255198
commit fa9159bb28
1 changed files with 1 additions and 2 deletions

View File

@ -118,9 +118,8 @@ class ConsumerSerializer(serializers.ModelSerializer):
""" """
# If the user has no right to see the note, then we only display the note identifier # 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): if PermissionBackend.check_perm(get_current_authenticated_user(), "note.view_note", obj.note):
print(obj.pk)
return NotePolymorphicSerializer().to_representation(obj.note) return NotePolymorphicSerializer().to_representation(obj.note)
return dict(id=obj.id) return dict(id=obj.note.id)
def get_email_confirmed(self, obj): def get_email_confirmed(self, obj):
if isinstance(obj.note, NoteUser): if isinstance(obj.note, NoteUser):