def quest_comment(request, comment_id): comment = QuestCommentDetails.from_id(comment_id) quest = QuestDetails.from_id(comment.quest_id) if request.user.is_authenticated(): comment.user.viewer_is_following = comment.user.id in request.user.following_ids() add_viewer_has_starred_field([comment], viewer=request.user) return { 'comment': comment, 'quest': quest, }
def quest_comment_share_page_url(comment_details): quest_comment = QuestCommentDetails.from_id(comment_details.id) return quest_comment.share_page_url
def get_share_page_url(comment_details): if getattr(comment_details, 'ugq', False) or isinstance(comment_details, QuestDetails): obj = QuestDetails.from_id(comment_details.id) else: obj = QuestCommentDetails.from_id(comment_details.id) return obj.share_page_url