mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
fix DetachedInstanceError on /admin/statistics (#133)
see http://stackoverflow.com/questions/15397680/detaching-sqlalchemy-instance-so-no-refresh-happens
This commit is contained in:
@@ -733,7 +733,8 @@ def admin_stats():
|
||||
least_solved_chal = Challenges.query.add_columns(solves_cnt) \
|
||||
.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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user