Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update authentication.py #602

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions gateone/auth/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
)
Expand Down
6 changes: 3 additions & 3 deletions terminal/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake8 suggests 2 spaces before an in-line comment (as in the original code).

imap, izip = map, zip
try:
xrange = xrange
except NameError: # Python 3 doesn't have xrange()
Expand Down