Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/project/redirects.py b/project/redirects.py
index 8c8b818..b49182a 100644
--- a/project/redirects.py
+++ b/project/redirects.py
@@ -1,7 +1,6 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""A class to forward requests to configured urls.
@@ -15,7 +14,6 @@
from six.moves import http_client
-from framework import flaskservlet
from framework import framework_helpers
from framework import servlet
from framework import urls
@@ -24,47 +22,39 @@
class WikiRedirect(servlet.Servlet):
"""Redirect to the wiki documentation, if provided."""
- def get(self, **kwargs):
+ def get(self):
"""Construct a 302 pointing at project.docs_url, or at adminIntro."""
if not self.mr.project:
- # TODO(crbug.com/monorail/10936): status in Flask is status_code
- # self.response.status_code = http_client.NOT_FOUND
- self.response.status = http_client.NOT_FOUND
+ self.response.status_code = http_client.NOT_FOUND
return
docs_url = self.mr.project.docs_url
if not docs_url:
docs_url = framework_helpers.FormatAbsoluteURL(
self.mr, urls.ADMIN_INTRO, include_project=True)
self.response.location = docs_url
- # TODO(crbug.com/monorail/10936): status in Flask is status_code
- # self.response.status_code = http_client.MOVED_PERMANENTLY
- self.response.status = http_client.MOVED_PERMANENTLY
+ self.response.status_code = http_client.MOVED_PERMANENTLY
- # def GetWikiListRedirect(self, **kwargs):
- # return self.handler(**kwargs)
+ def GetWikiListRedirect(self, **kwargs):
+ return self.handler(**kwargs)
- # def GetWikiRedirect(self, **kwargs):
- # return self.handler(**kwargs)
+ def GetWikiRedirect(self, **kwargs):
+ return self.handler(**kwargs)
class SourceRedirect(servlet.Servlet):
"""Redirect to the source browser, if provided."""
- def get(self, **kwargs):
+ def get(self):
"""Construct a 302 pointing at project.source_url, or at adminIntro."""
if not self.mr.project:
- # TODO(crbug.com/monorail/10936): status in Flask is status_code
- # self.response.status_code = http_client.NOT_FOUND
- self.response.status = http_client.NOT_FOUND
+ self.response.status_code = http_client.NOT_FOUND
return
source_url = self.mr.project.source_url
if not source_url:
source_url = framework_helpers.FormatAbsoluteURL(
self.mr, urls.ADMIN_INTRO, include_project=True)
self.response.location = source_url
- # TODO(crbug.com/monorail/10936): status in Flask is status_code
- # self.response.status_code = http_client.MOVED_PERMANENTLY
- self.response.status = http_client.MOVED_PERMANENTLY
+ self.response.status_code = http_client.MOVED_PERMANENTLY
- # def GetSourceRedirect(self, **kwargs):
- # return self.handler(**kwargs)
+ def GetSourceRedirect(self, **kwargs):
+ return self.handler(**kwargs)