OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is govered by a BSD-style |
| 3 # license that can be found in the LICENSE file or at |
| 4 # https://developers.google.com/open-source/licenses/bsd |
| 5 |
| 6 """Class that implements the artifact update collision page. |
| 7 |
| 8 This page is displayed only when one user views and edits an issue, |
| 9 but another user has already submitted an issue update before the |
| 10 first user submits his/her update. |
| 11 |
| 12 TODO(jrobbins): give the user better options on how to proceed. |
| 13 |
| 14 Summary of classes: |
| 15 ArtifactCollision: Show an error message explaining the mid-air collision. |
| 16 """ |
| 17 |
| 18 import re |
| 19 |
| 20 from framework import monorailrequest |
| 21 from framework import servlet |
| 22 |
| 23 |
| 24 class ArtifactCollision(servlet.Servlet): |
| 25 """ArtifactCollision page explains that a mid-air collision has occured.""" |
| 26 |
| 27 _PAGE_TEMPLATE = 'framework/artifact-collision-page.ezt' |
| 28 _MAIN_TAB_MODE = servlet.Servlet.MAIN_TAB_NONE |
| 29 |
| 30 def GatherPageData(self, mr): |
| 31 """Build up a dictionary of data values to use when rendering the page. |
| 32 |
| 33 Args: |
| 34 mr: commonly used info parsed from the request. |
| 35 |
| 36 Returns: |
| 37 A dict of values used by EZT for rendering the page. |
| 38 """ |
| 39 artifact_name = mr.GetParam('name') |
| 40 if not artifact_name: |
| 41 raise monorailrequest.InputException() # someone forged a link |
| 42 |
| 43 artifact_detail_url = '/p/%s/issues/detail?id=%s' % ( |
| 44 mr.project_name, mr.continue_issue_id) |
| 45 |
| 46 return { |
| 47 'artifact_name': artifact_name, |
| 48 'artifact_detail_url': artifact_detail_url, |
| 49 } |
OLD | NEW |