Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
8b1a8f77
Commit
8b1a8f77
authored
Jan 02, 2017
by
David Haynes
Browse files
Update cas script to comply with python 3
- now with less "u"'s
parent
a22ac444
Changes
1
Hide whitespace changes
Inline
Side-by-side
go/go/cas_callbacks.py
View file @
8b1a8f77
...
...
@@ -4,7 +4,6 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
# Django Imports
from
django.contrib.auth.models
import
User
from
django.conf
import
settings
from
django.contrib
import
messages
# third party imports
import
requests
...
...
@@ -41,7 +40,7 @@ def pfinfo(uname):
except
requests
.
exceptions
.
RequestException
as
e
:
print
(
"Cannot resolve to peoplefinder api:"
,
e
)
print
(
"Returning empty user info tuple."
)
return
[
u
''
,
u
''
]
return
[
''
,
''
]
else
:
pfjson
=
metadata
.
json
()
try
:
...
...
@@ -66,11 +65,11 @@ def pfinfo(uname):
# if the name is not in peoplefinder, return empty first and last name
except
IndexError
:
print
(
"Name not found in peoplefinder."
)
return
[
u
''
,
u
''
]
return
[
''
,
''
]
except
Exception
as
e
:
print
(
"Unknown peoplefinder error:"
,
e
)
print
(
"Returning empty user info tuple."
)
return
[
u
''
,
u
''
]
return
[
''
,
''
]
"""
create a django user based off of the peoplefinder info we parsed earlier
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment