def add_publish_button(self):
        current_post = getattr(self.request, get_setting('CURRENT_POST_IDENTIFIER'), None)
        if (self.toolbar.edit_mode and current_post and
                not current_post.publish and
                self.request.user.has_perm('djangocms_blog.change_post')
            ):  # pragma: no cover  # NOQA
            classes = ['cms-btn-action', 'blog-publish']
            title = _('Publish {0} now').format(current_post.app_config.object_name)

            url = admin_reverse('djangocms_blog_publish_article', args=(current_post.pk,))

            self.toolbar.add_button(title, url=url, extra_classes=classes, side=self.toolbar.RIGHT)
Adds the publish button to the toolbar if the current post is unpublished
dataset/ETHPy150Open nephila/djangocms-blog/djangocms_blog/cms_toolbar.py/BlogToolbar.add_publish_button