Commit d542601a authored by Daniel W Bond's avatar Daniel W Bond

added exception handling for cas call

parent a183259e
......@@ -46,8 +46,11 @@ def pfinfo(u_name):
def create_user(tree):
print("Parsing CAS information.")
username = tree[0][0].text
user, user_created = User.objects.get_or_create(username=username)
try:
username = tree[0][0].text
user, user_created = User.objects.get_or_create(username=username)
except Exception as e:
print("CAS callback unsuccessful:", e)
if user_created:
user.email = "%s@%s" % (username, settings.ORGANIZATION_EMAIL_DOMAIN)
......
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