fix DetachedInstanceError on /admin/statistics (#133)

see http://stackoverflow.com/questions/15397680/detaching-sqlalchemy-instance-so-no-refresh-happens
selenium-screenshot-testing
wangxiyu191 2016-07-28 12:00:45 +08:00 committed by Kevin Chung
parent 011e2c33c3
commit 70a0245e89
1 changed files with 2 additions and 1 deletions

View File

@ -734,6 +734,7 @@ def admin_stats():
.outerjoin(solves_sub, solves_sub.columns.chalid == Challenges.id) \
.order_by(solves_cnt.asc()).first()
db.session.expunge_all()
db.session.commit()
db.session.close()