Merge branch 'main' into avm99963-monorail

Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266

GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/tracker/issueattachment.py b/tracker/issueattachment.py
index 26982d0..6554447 100644
--- a/tracker/issueattachment.py
+++ b/tracker/issueattachment.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.
 
 """Issue Tracker code to serve out issue attachments.
 
@@ -14,26 +13,16 @@
 from __future__ import division
 from __future__ import absolute_import
 
-import base64
 import logging
-import os
-import re
-from six.moves import urllib
 
 from google.appengine.api import app_identity
-from google.appengine.api import images
 
 from framework import exceptions
-from framework import flaskservlet
 from framework import framework_constants
-from framework import framework_helpers
 from framework import gcs_helpers
-from framework import permissions
 from framework import servlet
-from framework import urls
 from tracker import attachment_helpers
 from tracker import tracker_helpers
-from tracker import tracker_views
 
 
 # This will likely appear blank or as a broken image icon in the browser.
@@ -88,8 +77,8 @@
           bucket_name, gcs_object_id, filename):
         gcs_object_id = gcs_object_id + '-download'
 
-    url = gcs_helpers.SignUrl(bucket_name, gcs_object_id)
-    self.redirect(url, abort=True)
+    redirect_url = gcs_helpers.SignUrl(bucket_name, gcs_object_id)
+    raise exceptions.RedirectException(redirect_url)
 
-  # def GetAttachmentPage(self, **kwargs):
-  #   return self.handler(**kwargs)
+  def GetAttachmentPage(self, **kwargs):
+    return self.handler(**kwargs)