'Redirecting preview function based on draft_id'

def preview_page(self, request, object_id, language):

    page = get_object_or_404(self.model, id=object_id)
    can_see_page = page_permissions.user_can_view_page(request.user, page)
    if (can_see_page and (not self.has_change_permission(request, obj=page))):
        can_see_page = page.is_published(language)
    if (not can_see_page):
        message = ugettext('You    don\'t    have    permissions    to    see    page    "%(title)s"')
        message = (message % {'title': force_text(page)})
        self.message_user(request, message, level=messages.ERROR)
        return HttpResponseRedirect('/en/admin/cms/page/')
    attrs = ('?%s' % get_cms_setting('CMS_TOOLBAR_URL__EDIT_ON'))
    attrs += ('&language=' + language)
    with force_language(language):
        url = (page.get_absolute_url(language) + attrs)
    site = get_current_site(request)
    if (not (site == page.site)):
        url = ('http%s://%s%s' % (('s' if request.is_secure() else ''), page.site.domain, url))
    return HttpResponseRedirect(url)
