diff --git a/gateone/auth/authentication.py b/gateone/auth/authentication.py index 9b702c7a..d404b801 100644 --- a/gateone/auth/authentication.py +++ b/gateone/auth/authentication.py @@ -645,9 +645,9 @@ def authenticate_redirect(self, callback=None): cas_server += '/' service_url = "%sauth" % self.base_url next_url = self.get_argument('next', None) - next_param = "" - if next_url: - next_param = "?next=" + quote(next_url) + next_param = "" + if next_url: + next_param = "?next=" + quote(next_url) redirect_url = '%slogin?service=%s%s' % (cas_server, quote(service_url), quote(next_param)) logging.debug("Redirecting to CAS URL: %s" % redirect_url) self.redirect(redirect_url) @@ -671,15 +671,15 @@ def get_authenticated_user(self, server_ticket): if cas_version == 1: validate_suffix = 'validate' next_url = self.get_argument('next', None) - next_param = "" - if next_url: - next_param = "?next=" + quote(next_url) + next_param = "" + if next_url: + next_param = "?next=" + quote(next_url) validate_url = ( cas_server + validate_suffix + '?service=' + quote(service_url) + - quote(next_param) + + quote(next_param) + '&ticket=' + quote(server_ticket) ) diff --git a/terminal/terminal.py b/terminal/terminal.py index 0ed4174d..426fba94 100644 --- a/terminal/terminal.py +++ b/terminal/terminal.py @@ -166,9 +166,9 @@ sys.exit(1) try: from itertools import imap, izip -except ImportError: # Python 3 doesn't have imap or izip in itertool - imap = map - izip = zip + pass +except ImportError: # Python 3 doesn't have imap or izip in itertool + imap, izip = map, zip try: xrange = xrange except NameError: # Python 3 doesn't have xrange()