changeset 197:891229adcf66

Use correct path for redirect after login.
author Daniele Nicolodi <daniele@grinta.net>
date Fri, 11 Nov 2011 12:28:36 +0100
parents 561585f470a4
children 234d57f3fd1d
files src/ltpdarepo/security.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ltpdarepo/security.py	Fri Nov 11 12:15:01 2011 +0100
+++ b/src/ltpdarepo/security.py	Fri Nov 11 12:28:36 2011 +0100
@@ -63,7 +63,9 @@
         @wraps(func)
         def decorated(*args, **kwargs):
             if 'username' not in session:
-                target = request.path != '/' and request.path or None
+                target = None
+                if request.path != '/':
+                    target = request.script_root + request.path
                 return redirect(url_for('login', next=target))
             if self.role not in g.identity.roles:
                 abort(403)