Skip to content

Commit

Permalink
Using streaming response for attendee_receipt_discrepancies
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbyt3r committed Oct 17, 2024
1 parent 3138004 commit 24a9003
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions uber/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def log_pageview(func):
def with_check(*args, **kwargs):
with uber.models.Session() as session:
try:
session.admin_account(cherrypy.session.get('account_id'))
session.current_admin_account()
except Exception:
pass # no tracking for non-admins yet
else:
Expand Down Expand Up @@ -579,9 +579,11 @@ 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):
yield chunk.encode(encoding)
return rendered


Expand Down
1 change: 1 addition & 0 deletions uber/site_sections/reg_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 24a9003

Please sign in to comment.