'Returns the username of the endorsing user, if the information is
available and would not identify the author of an anonymous thread.'

def get_endorsed_by(self, obj):

    endorsement = obj.get('endorsement')
    if endorsement:
        endorser_id = int(endorsement['user_id'])
        if (not (self._is_anonymous(self.context['thread']) and (not self._is_user_privileged(endorser_id)))):
            return DjangoUser.objects.get(id=endorser_id).username
    return None
