ckan/ckan — pull request #1714 by joetsoi (2014-07-24 10:38:13+00:00)
Title: `get_site_user` performs a commit on each call

Unless you provide `defer_commit` in the context. This is caused by a bad indentation.

This causes `DetachedInstanceError` SQLAlchemy errors, which are notoriously difficult to debug

**Update:** Turns out we might need to do the commit after all because we're using sqlalchemy scoped sessions, which opens a transaction even if you just do a select.