Skip to content

Commit

Permalink
Put session.expunge() back
Browse files Browse the repository at this point in the history
Without this, we were saving every object created in a page handler, which we rely on NOT happening for a bunch of our pages. This will fix the dept head checklist.
  • Loading branch information
kitsuta committed Oct 19, 2024
1 parent b0af461 commit f180636
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uber/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ def with_session(*args, **kwargs):
with uber.models.Session() as session:
try:
retval = func(*args, session=session, **kwargs)
session.expunge_all()
return retval
except HTTPRedirect:
session.commit()
Expand Down Expand Up @@ -593,7 +594,7 @@ def render(template_name_list, data=None, encoding='utf-8'):
template = env.get_or_select_template(template_name_list)
rendered = template.render(data)
if encoding:
return rendered.encode(encoding)
return rendered.encode(encoding)
return rendered


Expand Down

0 comments on commit f180636

Please sign in to comment.