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

Side by Side Diff: chromium-shortener/new-crbug/redirect.py

Issue 12208137: Add code for www.crbug and new.crbug appengine apps. (Closed) Base URL: https://src.chromium.org/chrome/trunk/tools/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « chromium-shortener/new-crbug/app_test.py ('k') | chromium-shortener/www-crbug/app.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import urllib
6 import webapp2
7
8 from google.appengine.api import users
9 from google.appengine.api.app_identity import get_application_id
10
11
12 APP_NAME = get_application_id()
13
14
15 class EasyTemplateRedirect(webapp2.RequestHandler):
16
17 def get(self):
18 user = users.get_current_user()
19 if not user:
20 # This shouldn't be possible, as app.yaml has "login: required" set,
21 # but catch it just in case.
22 self.redirect(users.create_login_url(self.request.url))
23 else:
24 if user.email().endswith('@chromium.org'):
25 self.redirect('http://chromiumbugs.appspot.com')
26 else:
27 self.redirect('http://code.google.com/p/chromium/issues')
28
29
30 class DeveloperTemplateRedirect(webapp2.RequestHandler):
31
32 def get(self):
33 self.redirect('http://code.google.com/p/chromium/issues/entry')
34
35
36 application = webapp2.WSGIApplication(
37 [('/', EasyTemplateRedirect),
38 ('/detailed', DeveloperTemplateRedirect),
39 ])
OLDNEW
« no previous file with comments | « chromium-shortener/new-crbug/app_test.py ('k') | chromium-shortener/www-crbug/app.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698