blob: 3008d543d6a0105eba81173490607171f6b670d2 [file] [log] [blame]
# 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
"""Redirect to /issues/entry or an external URL (like the wizard).
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import logging
from framework import flaskservlet
from framework import servlet
from framework import servlet_helpers
class IssueEntryAfterLogin(servlet.Servlet):
"""Redirect after clicking "New issue" and logging in."""
# Note: This servlet does not use an HTML template.
def GatherPageData(self, mr):
"""Build up a dictionary of data values to use when rendering the page."""
if not mr.auth.user_id:
self.abort(400, 'Only signed-in users should reach this URL.')
entry_page_url = servlet_helpers.ComputeIssueEntryURL(mr)
logging.info('Redirecting to %r', entry_page_url)
self.redirect(entry_page_url, abort=True)
# def GetIssueEntryAfterLogin(self, **kwargs):
# return self.handler(**kwargs)