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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromium-shortener/new-crbug/redirect.py
===================================================================
--- chromium-shortener/new-crbug/redirect.py (revision 0)
+++ chromium-shortener/new-crbug/redirect.py (revision 0)
@@ -0,0 +1,39 @@
+# Copyright (c) 2012 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.
+
+import urllib
+import webapp2
+
+from google.appengine.api import users
+from google.appengine.api.app_identity import get_application_id
+
+
+APP_NAME = get_application_id()
+
+
+class EasyTemplateRedirect(webapp2.RequestHandler):
+
+ def get(self):
+ user = users.get_current_user()
+ if not user:
+ # This shouldn't be possible, as app.yaml has "login: required" set,
+ # but catch it just in case.
+ self.redirect(users.create_login_url(self.request.url))
+ else:
+ if user.email().endswith('@chromium.org'):
+ self.redirect('http://chromiumbugs.appspot.com')
+ else:
+ self.redirect('http://code.google.com/p/chromium/issues')
+
+
+class DeveloperTemplateRedirect(webapp2.RequestHandler):
+
+ def get(self):
+ self.redirect('http://code.google.com/p/chromium/issues/entry')
+
+
+application = webapp2.WSGIApplication(
+ [('/', EasyTemplateRedirect),
+ ('/detailed', DeveloperTemplateRedirect),
+ ])
« 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