code: def publish_post(self, request, pk):
          
          language = get_language_from_request(request, check_path=True)
          try:
              post = Post.objects.get(pk=int(pk))
              post.publish = True
              post.save()
              return HttpResponseRedirect(post.get_absolute_url(language))
          except Exception:
              try:
                  return HttpResponseRedirect(request.META['HTTP_REFERER'])
              except KeyError:
                  return HttpResponseRedirect(reverse('djangocms_blog:posts-latest'))
docs: Admin view to publish a single post
  
          :param request: request
          :param pk: primary key of the post to publish
          :return: Redirect to the post itself (if found) or fallback urls