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

Side by Side Diff: appengine/monorail/project/wikiredirect.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
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 """A class to forward requests to the provided documentation url.
7
8 This page handles the /wiki urls which are forwarded from Codesite.
9 If a project has defined a docs_url, then the requests are forwarded there.
10 If not, they are redirected to adminIntro.
11 """
12
13 import httplib
14
15 from framework import framework_helpers
16 from framework import servlet
17 from framework import urls
18
19
20 class WikiRedirect(servlet.Servlet):
21 """Redirect to the wiki documentation, if provided."""
22
23 def get(self, **kwargs):
24 """Construct a 302 pointing at project.docs_url, or at adminIntro."""
25 docs_url = self.mr.project.docs_url
26 if not docs_url:
27 docs_url = framework_helpers.FormatAbsoluteURL(
28 self.mr, urls.ADMIN_INTRO, include_project=True)
29 self.response.location = docs_url
30 self.response.status = httplib.MOVED_PERMANENTLY
OLDNEW
« no previous file with comments | « appengine/monorail/project/test/projectupdates_test.py ('k') | appengine/monorail/proto/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698