blob: 3008d543d6a0105eba81173490607171f6b670d2 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed 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"""Redirect to /issues/entry or an external URL (like the wizard).
7"""
8from __future__ import print_function
9from __future__ import division
10from __future__ import absolute_import
11
12import logging
13
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020014from framework import flaskservlet
Copybara854996b2021-09-07 19:36:02 +000015from framework import servlet
16from framework import servlet_helpers
17
18
19class IssueEntryAfterLogin(servlet.Servlet):
20 """Redirect after clicking "New issue" and logging in."""
21
22 # Note: This servlet does not use an HTML template.
23
24 def GatherPageData(self, mr):
25 """Build up a dictionary of data values to use when rendering the page."""
26 if not mr.auth.user_id:
27 self.abort(400, 'Only signed-in users should reach this URL.')
28
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020029 entry_page_url = servlet_helpers.ComputeIssueEntryURL(mr)
Copybara854996b2021-09-07 19:36:02 +000030 logging.info('Redirecting to %r', entry_page_url)
31 self.redirect(entry_page_url, abort=True)
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020032
33 # def GetIssueEntryAfterLogin(self, **kwargs):
34 # return self.handler(**kwargs)