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

Unified Diff: appengine/findit/common/base_handler.py

Issue 2506893003: [Findit] After login, redirect to the targeted page for GETs, but original page for others like POS… (Closed)
Patch Set: Fix nits. Created 4 years, 1 month 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 | « no previous file | appengine/findit/common/test/base_handler_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/common/base_handler.py
diff --git a/appengine/findit/common/base_handler.py b/appengine/findit/common/base_handler.py
index ab374fdc3c7487515b5a4527e4f9cc02186abb6b..7baba606a9279409435b8c840aa56c93e9ee06cb 100644
--- a/appengine/findit/common/base_handler.py
+++ b/appengine/findit/common/base_handler.py
@@ -152,7 +152,13 @@ class BaseHandler(webapp2.RequestHandler):
def GetLoginUrl(self):
"""Returns the login url."""
- return users.create_login_url(self.request.referer or self.request.uri)
+ if self.request.method == 'GET':
+ # For GET, all parameters are included in the URL.
+ return users.create_login_url(self.request.url)
+ else:
+ # For others like POST, the parameters could be in the body and include
+ # file, etc. Thus return to the original page if available.
+ return users.create_login_url(self.request.referrer)
def _Handle(self, handler_func):
try:
« no previous file with comments | « no previous file | appengine/findit/common/test/base_handler_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698