def _save_and_commit(self, request, obj):
    site = self.get_site()
    commit_model = site.get_version_tracker_model().commit_model
    if (not site.has_add_permission(request, obj, commit_model)):
        messages.error(request, _("You don't have permission to commit."))
    else:
        if obj.root_node.has_changes():
            obj.root_node.commit(user=request.user)
        elif self.has_review_queue:
            messages.warning(request, _('There was nothing to submit for review.'))
        if (not self.has_review_queue):
            obj.status = CONTENT_STATUS_PUBLISHED
def _save_and_commit(self, request, obj):
    site = self.get_site()
    commit_model = site.get_version_tracker_model().commit_model
    if (not site.has_add_permission(request, obj, commit_model)):
        messages.error(request, _("You don't have permission to commit."))
    else:
        if obj.root_node.has_changes():
            obj.root_node.commit(user=request.user)
        elif self.has_review_queue:
            messages.warning(request, _('There was nothing to submit for review.'))
        if (not self.has_review_queue):
            obj.status = CONTENT_STATUS_PUBLISHED