Commit 8b1a8f77 authored by David Haynes's avatar David Haynes
Browse files

Update cas script to comply with python 3

- now with less "u"'s
parent a22ac444
...@@ -4,7 +4,6 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi ...@@ -4,7 +4,6 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi
# Django Imports # Django Imports
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.conf import settings from django.conf import settings
from django.contrib import messages
# third party imports # third party imports
import requests import requests
...@@ -41,7 +40,7 @@ def pfinfo(uname): ...@@ -41,7 +40,7 @@ def pfinfo(uname):
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
print("Cannot resolve to peoplefinder api:", e) print("Cannot resolve to peoplefinder api:", e)
print("Returning empty user info tuple.") print("Returning empty user info tuple.")
return [u'', u''] return ['', '']
else: else:
pfjson = metadata.json() pfjson = metadata.json()
try: try:
...@@ -66,11 +65,11 @@ def pfinfo(uname): ...@@ -66,11 +65,11 @@ def pfinfo(uname):
# if the name is not in peoplefinder, return empty first and last name # if the name is not in peoplefinder, return empty first and last name
except IndexError: except IndexError:
print("Name not found in peoplefinder.") print("Name not found in peoplefinder.")
return [u'',u''] return ['','']
except Exception as e: except Exception as e:
print("Unknown peoplefinder error:", e) print("Unknown peoplefinder error:", e)
print("Returning empty user info tuple.") print("Returning empty user info tuple.")
return [u'', u''] return ['', '']
""" """
create a django user based off of the peoplefinder info we parsed earlier create a django user based off of the peoplefinder info we parsed earlier
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment