Description:
fix exclude admin in report
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r428:06bd0f1beeb4 - - 1 file changed: 2 inserted, 2 deleted
@@ -113,50 +113,50 | |||
|
113 | 113 | memory: { avail: false, value: 2**30-1 }, |
|
114 | 114 | length: { avail: false, value: 2**30-1 }, |
|
115 | 115 | first: { avail: false, value: DateTime.new(3000,1,1) } |
|
116 | 116 | } |
|
117 | 117 | end |
|
118 | 118 | |
|
119 | 119 | if sub.max_runtime and sub.max_runtime < @by_lang[lang.pretty_name][:runtime][:value] |
|
120 | 120 | @by_lang[lang.pretty_name][:runtime] = { |
|
121 | 121 | avail: true, |
|
122 | 122 | user_id: sub.user_id, |
|
123 | 123 | value: sub.max_runtime, |
|
124 | 124 | sub_id: sub.id |
|
125 | 125 | } |
|
126 | 126 | end |
|
127 | 127 | |
|
128 | 128 | if sub.peak_memory and sub.peak_memory < @by_lang[lang.pretty_name][:memory][:value] |
|
129 | 129 | @by_lang[lang.pretty_name][:memory] = { |
|
130 | 130 | avail: true, |
|
131 | 131 | user_id: sub.user_id, |
|
132 | 132 | value: sub.peak_memory, |
|
133 | 133 | sub_id: sub.id |
|
134 | 134 | } |
|
135 | 135 | end |
|
136 | 136 | |
|
137 | - if sub.user.admin? == false and | |
|
138 | - sub.submitted_at and sub.submitted_at < @by_lang[lang.pretty_name][:first][:value] | |
|
137 | + if sub.submitted_at and sub.submitted_at < @by_lang[lang.pretty_name][:first][:value] and | |
|
138 | + !sub.user.admin? | |
|
139 | 139 | @by_lang[lang.pretty_name][:first] = { |
|
140 | 140 | avail: true, |
|
141 | 141 | user_id: sub.user_id, |
|
142 | 142 | value: sub.submitted_at, |
|
143 | 143 | sub_id: sub.id |
|
144 | 144 | } |
|
145 | 145 | end |
|
146 | 146 | |
|
147 | 147 | if @by_lang[lang.pretty_name][:length][:value] > sub.effective_code_length |
|
148 | 148 | @by_lang[lang.pretty_name][:length] = { |
|
149 | 149 | avail: true, |
|
150 | 150 | user_id: sub.user_id, |
|
151 | 151 | value: sub.effective_code_length, |
|
152 | 152 | sub_id: sub.id |
|
153 | 153 | } |
|
154 | 154 | end |
|
155 | 155 | end |
|
156 | 156 | |
|
157 | 157 | #process user_id |
|
158 | 158 | @by_lang.each do |lang,prop| |
|
159 | 159 | prop.each do |k,v| |
|
160 | 160 | v[:user] = User.exists?(v[:user_id]) ? User.find(v[:user_id]).full_name : "(NULL)" |
|
161 | 161 | end |
|
162 | 162 | end |
You need to be logged in to leave comments.
Login now