Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: appengine/monorail/framework/artifactcollision.py

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/monorail/framework/alerts.py ('k') | appengine/monorail/framework/banned.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « appengine/monorail/framework/alerts.py ('k') | appengine/monorail/framework/banned.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698