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
0c7199da
Commit
0c7199da
authored
Oct 05, 2016
by
Nicholas Anderson
Browse files
FIXED THE STUFF
parent
3b91ebb2
Pipeline
#367
passed with stage
in 5 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
go/go/cas_callbacks.py
View file @
0c7199da
...
...
@@ -38,12 +38,22 @@ def pfinfo(uname):
pfjson
=
metadata
.
json
()
try
:
if
len
(
pfjson
[
'results'
])
==
1
:
name_str
=
pfjson
[
'results'
][
0
][
'name'
]
name
=
pfparse
(
name_str
)
if
pfjson
[
'method'
]
==
'peoplefinder'
:
name_str
=
pfjson
[
'results'
][
0
][
'name'
]
name
=
pfparse
(
name_str
)
elif
pfjson
[
'method'
]
==
'ldap'
:
name
=
[
pfjson
[
'results'
][
0
][
'givenname'
],
pfjson
[
'results'
][
0
][
'surname'
]]
else
:
name
=
pfjson
[
'results'
][
0
][
'name'
]
return
name
else
:
name_str
=
pfjson
[
'results'
][
1
][
'name'
]
name
=
pfparse
(
name_str
)
if
pfjson
[
'method'
]
==
'peoplefinder'
:
name_str
=
pfjson
[
'results'
][
1
][
'name'
]
name
=
pfparse
(
name_str
)
elif
pfjson
[
'method'
]
==
'ldap'
:
name
=
[
pfjson
[
'results'
][
1
][
'givenname'
],
pfjson
[
'results'
][
1
][
'surname'
]]
else
:
name
=
pfjson
[
'results'
][
0
][
'name'
]
return
name
# if the name is not in peoplefinder, return empty first and last name
except
IndexError
:
...
...
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