OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import webapp2 | 5 import webapp2 |
6 import cgi | 6 import cgi |
7 | 7 |
8 from shared.utils import (guess_legacy_codereview_hostname, | 8 from shared import utils |
9 get_full_patchset_url) | 9 |
10 | 10 |
11 class PatchStatus(webapp2.RequestHandler): # pragma: no cover | 11 class PatchStatus(webapp2.RequestHandler): # pragma: no cover |
| 12 @utils.read_access |
12 def get(self, issue, patchset): # pylint: disable=W0221 | 13 def get(self, issue, patchset): # pylint: disable=W0221 |
13 codereview_hostname = guess_legacy_codereview_hostname(issue) | 14 codereview_hostname = utils.guess_legacy_codereview_hostname(issue) |
14 full_patchset_url = get_full_patchset_url(codereview_hostname, issue, | 15 full_patchset_url = utils.get_full_patchset_url(codereview_hostname, issue, |
15 patchset) | 16 patchset) |
16 self.response.write(open('templates/patch_status.html').read() % { | 17 self.response.write(open('templates/patch_status.html').read() % { |
17 'codereview_hostname': cgi.escape(codereview_hostname, quote=True), | 18 'codereview_hostname': cgi.escape(codereview_hostname, quote=True), |
18 'full_patchset_url': cgi.escape(full_patchset_url, quote=True), | 19 'full_patchset_url': cgi.escape(full_patchset_url, quote=True), |
19 'issue': cgi.escape(issue, quote=True), | 20 'issue': cgi.escape(issue, quote=True), |
20 'patchset': cgi.escape(patchset, quote=True), | 21 'patchset': cgi.escape(patchset, quote=True), |
21 }) | 22 }) |
22 | 23 |
23 | 24 |
24 class PatchStatusV2(webapp2.RequestHandler): # pragma: no cover | 25 class PatchStatusV2(webapp2.RequestHandler): # pragma: no cover |
| 26 @utils.read_access |
25 def get(self, codereview_hostname, issue, patchset): # pylint: disable=W0221 | 27 def get(self, codereview_hostname, issue, patchset): # pylint: disable=W0221 |
26 full_patchset_url = get_full_patchset_url(codereview_hostname, issue, | 28 full_patchset_url = utils.get_full_patchset_url(codereview_hostname, issue, |
27 patchset) | 29 patchset) |
28 self.response.write(open('templates/patch_status.html').read() % { | 30 self.response.write(open('templates/patch_status.html').read() % { |
29 'codereview_hostname': cgi.escape(codereview_hostname, quote=True), | 31 'codereview_hostname': cgi.escape(codereview_hostname, quote=True), |
30 'full_patchset_url': cgi.escape(full_patchset_url, quote=True), | 32 'full_patchset_url': cgi.escape(full_patchset_url, quote=True), |
31 'issue': cgi.escape(issue, quote=True), | 33 'issue': cgi.escape(issue, quote=True), |
32 'patchset': cgi.escape(patchset, quote=True), | 34 'patchset': cgi.escape(patchset, quote=True), |
33 }) | 35 }) |
OLD | NEW |