def _get_html_and_errors(request, doc, rendering_params):
 (doc_html, ks_errors) = (doc.html, None)
 render_raw_fallback = False
 base_url = request.build_absolute_uri('/')
 if rendering_params['use_rendered']:
  if ((request.GET.get('bleach_new', False) is not False) and request.user.is_authenticated()):
   (doc_html, ks_errors) = kumascript.post(request, doc_html, request.LANGUAGE_CODE, True)
  else:
   cache_control = None
   if request.user.is_authenticated():
    ua_cc = request.META.get('HTTP_CACHE_CONTROL')
    if (ua_cc == 'no-cache'):
     cache_control = 'no-cache'
   try:
    (r_body, r_errors) = doc.get_rendered(cache_control, base_url)
    if r_body:
     doc_html = r_body
    if r_errors:
     ks_errors = r_errors
   except DocumentRenderedContentNotAvailable:
    render_raw_fallback = True
 return (doc_html, ks_errors, render_raw_fallback)

def _get_html_and_errors ( request , doc , rendering_params ) : ( doc_html , ks_errors ) = ( doc . html , None ) render_raw_fallback = False base_url = request . build_absolute_uri ( '/' ) if rendering_params [ 'use_rendered' ] : if ( ( request . GET . get ( 'bleach_new' , False ) is not False ) and request . user . is_authenticated ( ) ) : ( doc_html , ks_errors ) = kumascript . post ( request , doc_html , request . LANGUAGE_CODE , True ) else : cache_control = None if request . user . is_authenticated ( ) : ua_cc = request . META . get ( 'HTTP_CACHE_CONTROL' ) if ( ua_cc == 'no-cache' ) : cache_control = 'no-cache' try : ( r_body , r_errors ) = doc . get_rendered ( cache_control , base_url ) if r_body : doc_html = r_body if r_errors : ks_errors = r_errors except DocumentRenderedContentNotAvailable : render_raw_fallback = True return ( doc_html , ks_errors , render_raw_fallback )
get the initial html for a document .