Exemple #1
0
 def get_actor_detail(self, obj):
     if obj.message[:13] == '익명의 사용자가 회원님의':
         return AuthorAnonymousSerializer(obj.actor).data
     return AuthorFriendSerializer(obj.actor).data
Exemple #2
0
 def get_author_detail(self, obj):
     return AuthorAnonymousSerializer(obj.author).data
Exemple #3
0
 def get_author_detail(self, obj):
     if obj.author == self.context.get('request', None).user:
         return AuthorFriendSerializer(obj.author).data
     return AuthorAnonymousSerializer(obj.author).data
Exemple #4
0
 def get_author_detail(self, obj):
     current_user = self.context.get('request', None).user
     if User.are_friends(current_user,
                         obj.author) or obj.author == current_user:
         return AuthorFriendSerializer(obj.author).data
     return AuthorAnonymousSerializer(obj.author).data