def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None, *args, **kwargs):
    if (not add):
        unapproved = 0
        future = 0
        for commit in obj.root_node.get_history_list():
            if obj.root_node.commit_is_ready(commit):
                break
            if (self.has_review_queue and (not commit.reviewedversioncommit.is_approved)):
                unapproved += 1
            if (not commit.is_published):
                future += 1
        if unapproved:
            messages.warning(request, ungettext('There is one unreviewed commit for this page.', 'There are {count} unreviewed commits for this page.', unapproved).format(count=unapproved))
        if future:
            messages.warning(request, ungettext('There is one future-scheduled commit.', 'There are {count} future-scheduled commits.', future).format(count=future))
    site = self.get_site()
    if add:
        status = CONTENT_STATUS_EMBRYO
    else:
        status = obj.status
    if self.has_review_queue:
        commit_model = site.get_version_tracker_model().commit_model
        can_approve = site.has_change_permission(request, commit_model)
        context['save_buttons'] = self.reviewed_buttons[(status, can_approve)]
    else:
        context['save_buttons'] = self.unreviewed_buttons[status]
    if (not add):
        context['history_url'] = site.reverse(site.history_view, kwargs={'pk': obj.root_node_id})
    return super(WidgyPageAdmin, self).render_change_form(request, context, add, change, form_url, obj, *args, **kwargs)
def render_change_form(self, request, context, add=False, change=False, form_url=, obj=None, *args, **kwargs):
    if (not add):
        unapproved = 0
        future = 0
        for commit in obj.root_node.get_history_list():
            if obj.root_node.commit_is_ready(commit):
                break
            if (self.has_review_queue and (not commit.reviewedversioncommit.is_approved)):
                unapproved += 1
            if (not commit.is_published):
                future += 1
        if unapproved:
            messages.warning(request, ungettext('There is one unreviewed commit for this page.', 'There are {count} unreviewed commits for this page.', unapproved).format(count=unapproved))
        if future:
            messages.warning(request, ungettext('There is one future-scheduled commit.', 'There are {count} future-scheduled commits.', future).format(count=future))
    site = self.get_site()
    if add:
        status = CONTENT_STATUS_EMBRYO
    else:
        status = obj.status
    if self.has_review_queue:
        commit_model = site.get_version_tracker_model().commit_model
        can_approve = site.has_change_permission(request, commit_model)
        context['save_buttons'] = self.reviewed_buttons[(status, can_approve)]
    else:
        context['save_buttons'] = self.unreviewed_buttons[status]
    if (not add):
        context['history_url'] = site.reverse(site.history_view, kwargs={'pk': obj.root_node_id})
    return super(WidgyPageAdmin, self).render_change_form(request, context, add, change, form_url, obj, *args, **kwargs)