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

More optimisation

This commit is contained in:
Yohann D'ANELLO
2020-03-20 02:05:41 +01:00
parent 6fc43e651e
commit 0ce6cd88b3
2 changed files with 22 additions and 17 deletions

View File

@ -84,10 +84,7 @@ class AliasSerializer(serializers.ModelSerializer):
read_only_fields = ('note', )
def get_note(self, alias):
if PermissionBackend().has_perm(get_current_authenticated_user(), "note.view_note", alias.note):
return NotePolymorphicSerializer().to_representation(alias.note)
else:
return alias.note.id
return alias.note.id
class NotePolymorphicSerializer(PolymorphicSerializer):