mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-09-21 00:13:18 +00:00
修复列表越界导致的异常
This commit is contained in:
parent
eb0a3447c5
commit
3b6cbc51a1
@ -485,7 +485,7 @@ def contest_rank_page(request, contest_id):
|
||||
rank = json.loads(rank)
|
||||
|
||||
# 2016-05-19 增加了缓存项目,以前的缓存主动失效
|
||||
if "rank_number" not in rank[0]:
|
||||
if rank and "rank_number" not in rank[0]:
|
||||
rank = _get_rank(contest_id)
|
||||
r.set(cache_key, json.dumps([dict(item) for item in rank]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user