mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
修复答题状态中的 keyerror
This commit is contained in:
parent
b34009a6b3
commit
59ede6f762
@ -50,6 +50,8 @@ class MessageQueue(object):
|
||||
|
||||
# 更新普通题目的计数器
|
||||
problem.add_submission_number()
|
||||
if "problems" not in problems_status:
|
||||
problems_status["problems"] = {}
|
||||
if submission.result == result["accepted"]:
|
||||
problem.add_ac_number()
|
||||
problems_status["problems"][str(problem.id)] = 1
|
||||
@ -88,6 +90,8 @@ class MessageQueue(object):
|
||||
problems_status = user.problems_status
|
||||
|
||||
contest_problem.add_submission_number()
|
||||
if "contest_problems" not in problems_status:
|
||||
problems_status["contest_problems"] = {}
|
||||
if submission.result == result["accepted"]:
|
||||
contest_problem.add_ac_number()
|
||||
problems_status["contest_problems"][str(contest_problem.id)] = 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user