diff --git a/uber/decorators.py b/uber/decorators.py index adfe4c9bf..334521f20 100644 --- a/uber/decorators.py +++ b/uber/decorators.py @@ -579,9 +579,14 @@ def render(template_name_list, data=None, encoding='utf-8'): data = renderable_data(data) env = JinjaEnv.env() template = env.get_or_select_template(template_name_list) - rendered = template.render(data) + cherrypy.response.stream = True + rendered = template.generate(data) if encoding: - return rendered.encode(encoding) + for idx, chunk in enumerate(rendered): + print(f"Rendering chunk {idx}") + import time + time.sleep(0.01) + yield chunk.encode(encoding) return rendered diff --git a/uber/site_sections/reg_reports.py b/uber/site_sections/reg_reports.py index ee4b1e218..a5cbd5a5e 100644 --- a/uber/site_sections/reg_reports.py +++ b/uber/site_sections/reg_reports.py @@ -60,6 +60,7 @@ def attendee_receipt_discrepancies(self, session, include_pending=False, page=1) 'attendees': receipt_query.limit(50).offset(offset), 'include_pending': include_pending, } + attendee_receipt_discrepancies._cp_config = {'response.stream': True} @log_pageview def attendees_nonzero_balance(self, session, include_no_receipts=False):