Milimetric has uploaded a new change for review.
https://gerrit.wikimedia.org/r/70193
Change subject: fixed re-routing after login and string concat problem
......................................................................
fixed re-routing after login and string concat problem
Change-Id: I4ffb50214213d7cdbca8a2a7f9107215aee1283a
---
M wikimetrics/controllers/authentication.py
1 file changed, 5 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics
refs/changes/93/70193/1
diff --git a/wikimetrics/controllers/authentication.py
b/wikimetrics/controllers/authentication.py
index cff9a60..2e0311c 100644
--- a/wikimetrics/controllers/authentication.py
+++ b/wikimetrics/controllers/authentication.py
@@ -26,6 +26,7 @@
return decorator(to_decorate)
+
if app.config['DEBUG']:
# safeguard against exposing this route in production
@app.route('/login-for-testing-only')
@@ -36,9 +37,7 @@
email='[email protected]',
)
login_user(user)
- print 'adding login-for-testing-only'
-else:
- print 'not adding login-for-testing-only'
+
@app.before_request
def default_to_private():
@@ -48,12 +47,12 @@
"""
if current_user.is_authenticated():
return
-
+
if (request.endpoint and
not 'static' in request.endpoint and
not getattr(app.view_functions[request.endpoint], 'is_public', False)
):
- return redirect(url_for('login'))
+ return redirect(url_for('login', next=url_for(request.endpoint)))
@login_manager.user_loader
@@ -61,7 +60,7 @@
"""
Callback required by Flask-Login. Gets the User object from the database.
"""
- print 'calling load_user on user_id=%d' % user_id
+ print 'calling load_user on user_id=%s' % user_id
db_session = db.get_session()
user = User.get(db_session, user_id)
return user
--
To view, visit https://gerrit.wikimedia.org/r/70193
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ffb50214213d7cdbca8a2a7f9107215aee1283a
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Milimetric <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits