Commit b0d0a566 authored by Mark Stenglein's avatar Mark Stenglein

Revert "Merge branch 'loginError' into '1.0'

This reverts commit d3dd949f, reversing
changes made to dcc97bd4.
parent 267f3fce
# core django imports
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
# third-part imports
import requests
# imports from your apps
......@@ -34,38 +33,20 @@ def create_user(tree):
if user_created:
user.email = "%s@%s" % (username, settings.ORGANIZATION_EMAIL_DOMAIN)
user.set_password('cas_used_instead')
print("Added user email and default password.")
print "Start peoplefinder parsing"
try:
name_list = pfinfo(str(username))
print name_list, "name_list"
first_name = name_list[1].lstrip().split(' ')
if len(first_name) > 1:
no_mi = first_name[:-1]
user.first_name = ' '.join(no_mi)
else:
user.first_name = ' '.join(first_name)
last_name = name_list[0]
user.last_name = name_list[0]
except Exception as e:
print("Unhandled peoplefinder exception:", e)
print "hello"
name_list = pfinfo(str(username))
print name_list, "name_list"
first_name = name_list[1].lstrip().split(' ')
if len(first_name) > 1:
no_mi = first_name[:-1]
user.first_name = ' '.join(no_mi)
else:
user.first_name = ' '.join(first_name)
last_name = name_list[0]
user.last_name = name_list[0]
print "world"
user.save()
print("Created user %s!" % username)
else:
print("User object already exists.")
# Student Creation Section
try:
Student.objects.get(user=user)
print("Student object already exists")
except ObjectDoesNotExist:
new_student = Student.objects.create(user=user)
# save the name off of peoplefinder for later quality assurance purposes
......@@ -73,6 +54,7 @@ def create_user(tree):
new_student.pf_last_name = user.last_name
new_student.save()
print("Created student object for user %s!" % username)
print("CAS callback completed.")
......@@ -7,7 +7,7 @@ argparse==1.2.1
boto==2.38.0
django-autoslug==1.7.2
django-braces==1.4.0
git+https://github.com/kstateome/django-cas.git
git+https://github.com/the-ben-waters/django-cas.git
django-crispy-forms==1.4.0
django-gravatar2==1.1.4
django-haystack==2.3.1
......
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