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
bookshare
Commits
e6bdf21b
Commit
e6bdf21b
authored
Jan 27, 2015
by
Daniel W Bond
Browse files
added cas callback for user creation
parent
9d0a93be
Changes
1
Show whitespace changes
Inline
Side-by-side
bookshare/core/cas_callbacks.py
0 → 100644
View file @
e6bdf21b
from
django.contrib.auth.models
import
User
from
django.conf
import
settings
def
create_user
(
tree
):
username
=
tree
[
0
][
0
].
text
user
,
user_created
=
User
.
objects
.
get_or_create
(
username
=
username
)
if
user_created
:
user
.
email
=
"%s@%s"
%
(
username
,
settings
.
ORGANIZATION_EMAIL_DOMAIN
)
user
.
save
()
new_student
=
Student
.
objects
.
create
()
new_student
.
user
=
user
print
(
"Created user %s!"
%
username
)
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