OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
6 | 6 |
7 from common.base_handler import BaseHandler | 7 from common.base_handler import BaseHandler, Permission |
8 from common.base_handler import Permission | |
9 | 8 |
10 | 9 |
11 def _FormatDatetime(dt): | 10 def _FormatDatetime(dt): |
12 if not dt: | 11 if not dt: |
13 return None # pragma: no cover | 12 return None # pragma: no cover |
14 else: | 13 else: |
15 return dt.strftime('%Y-%m-%d %H:%M:%S UTC') | 14 return dt.strftime('%Y-%m-%d %H:%M:%S UTC') |
16 | 15 |
17 | 16 |
18 class Culprit(BaseHandler): | 17 class Culprit(BaseHandler): |
(...skipping 17 matching lines...) Expand all Loading... |
36 data = { | 35 data = { |
37 'project_name': culprit.project_name, | 36 'project_name': culprit.project_name, |
38 'revision': culprit.revision, | 37 'revision': culprit.revision, |
39 'commit_position': culprit.commit_position, | 38 'commit_position': culprit.commit_position, |
40 'cr_notified': culprit.cr_notified, | 39 'cr_notified': culprit.cr_notified, |
41 'cr_notification_time': _FormatDatetime(culprit.cr_notification_time), | 40 'cr_notification_time': _FormatDatetime(culprit.cr_notification_time), |
42 'builds': map(ConvertBuildInfoToADict, culprit.builds), | 41 'builds': map(ConvertBuildInfoToADict, culprit.builds), |
43 'key': key, | 42 'key': key, |
44 } | 43 } |
45 return {'template': 'waterfall/culprit.html', 'data': data} | 44 return {'template': 'waterfall/culprit.html', 'data': data} |
OLD | NEW |