mirror of https://github.com/JohnHammond/CTFd.git
Handling situation with no solves
parent
3f596d87b1
commit
f4fec18f44
|
@ -740,8 +740,11 @@ def admin_stats():
|
||||||
for chal, count, name in solves:
|
for chal, count, name in solves:
|
||||||
solve_data[name] = count
|
solve_data[name] = count
|
||||||
|
|
||||||
most_solved = max(solve_data, key=solve_data.get)
|
most_solved = None
|
||||||
least_solved = min(solve_data, key=solve_data.get)
|
least_solved = None
|
||||||
|
if len(solve_data):
|
||||||
|
most_solved = max(solve_data, key=solve_data.get)
|
||||||
|
least_solved = min(solve_data, key=solve_data.get)
|
||||||
|
|
||||||
db.session.expunge_all()
|
db.session.expunge_all()
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
Loading…
Reference in New Issue