Description:
fix submission report, when submissions belong no non-existing user
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r415:8de9a512ac85 - - 1 file changed: 13 inserted, 11 deleted

@@ -51,20 +51,22
51 end
51 end
52
52
53 Submission.where("submitted_at >= ? AND submitted_at <= ?",@since_time,@until_time).find_each do |s|
53 Submission.where("submitted_at >= ? AND submitted_at <= ?",@since_time,@until_time).find_each do |s|
54 - if not @submissions[s.user_id][:sub].has_key?(s.problem_id)
54 + if @submissions[s.user_id]
55 - a = nil
55 + if not @submissions[s.user_id][:sub].has_key?(s.problem_id)
56 - begin
57 - a = Problem.find(s.problem_id)
58 - rescue
59 a = nil
56 a = nil
57 + begin
58 + a = Problem.find(s.problem_id)
59 + rescue
60 + a = nil
61 + end
62 + @submissions[s.user_id][:sub][s.problem_id] =
63 + { prob_name: (a ? a.full_name : '(NULL)'),
64 + sub_ids: [s.id] }
65 + else
66 + @submissions[s.user_id][:sub][s.problem_id][:sub_ids] << s.id
60 end
67 end
61 - @submissions[s.user_id][:sub][s.problem_id] =
68 + @submissions[s.user_id][:count] += 1
62 - { prob_name: (a ? a.full_name : '(NULL)'),
63 - sub_ids: [s.id] }
64 - else
65 - @submissions[s.user_id][:sub][s.problem_id][:sub_ids] << s.id
66 end
69 end
67 - @submissions[s.user_id][:count] += 1
68 end
70 end
69 end
71 end
70 end
72 end
You need to be logged in to leave comments. Login now