def METHOD_NAME(request, post_type, post_slug):
    post = get_object_or_404(Post, slug=post_slug)
    # post_type can be changed by moderator
    if post.type != post_type:
        return redirect("show_post", post.type, post.slug)
    # drafts are visible only to authors, coauthors and moderators
    if not post.can_view(request.me):
        raise Http404()
    # don't show private posts into public
    if not post.is_public:
        access_denied = check_user_permissions(request, post=post)
        if access_denied:
            return access_denied
    # record a new view
    last_view_at = None
    if request.me:
        request.me.update_last_activity()
        post_view, last_view_at = PostView.register_view(
            request=request,
            user=request.me,
            post=post,
        )
    else:
        PostView.register_anonymous_view(
            request=request,
            post=post,
        )
    # find linked posts and sort them by upvotes
    linked_posts = sorted({
        link.post_to if link.post_to != post else link.post_from
        for link in LinkedPost.links_for_post(post)[:50]
    }, key=lambda p: p.upvotes, reverse=True)
    # force cleanup deleted/hidden posts from linked
    linked_posts = [p for p in linked_posts if p.is_visible]
    return render_post(request, post, {
        "post_last_view_at": last_view_at,
        "linked_posts": linked_posts,
    })