More optimisation
This commit is contained in:
parent
6fc43e651e
commit
0ce6cd88b3
2 changed files with 22 additions and 17 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue