'Returns the URL to retrieve the thread\'s comments, optionally including
the endorsed query parameter.'

def get_comment_list_url(self, obj, endorsed=None):

    if (((obj['thread_type'] == 'question') and (endorsed is None)) or ((obj['thread_type'] == 'discussion') and (endorsed is not None))):
        return None
    path = reverse('comment-list')
    query_dict = {'thread_id': obj['id']}
    if (endorsed is not None):
        query_dict['endorsed'] = endorsed
    return self.context['request'].build_absolute_uri(urlunparse(('', '', path, '', urlencode(query_dict), '')))
