Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
b612517d
Commit
b612517d
authored
12 years ago
by
ichuang
Browse files
Options
Downloads
Plain Diff
Merge branch 'lms-migration' of github.com:MITx/mitx into lms-migration
parents
c42960c1
3ee224e3
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utility-scripts/create_user.py
+18
-9
18 additions, 9 deletions
utility-scripts/create_user.py
with
18 additions
and
9 deletions
utility-scripts/create_user.py
+
18
−
9
View file @
b612517d
...
...
@@ -56,17 +56,9 @@ while True:
else
:
break
while
True
:
email
=
raw_input
(
'
email:
'
)
if
User
.
objects
.
filter
(
email
=
email
):
print
"
email %s already taken
"
%
email
else
:
break
name
=
raw_input
(
'
Full name:
'
)
make_eamap
=
False
if
raw_input
(
'
Create MIT ExternalAuth? [n]
'
).
lower
()
==
'
y
'
:
email
=
'
%s@MIT.EDU
'
%
uname
if
not
email
.
endswith
(
'
@MIT.EDU
'
):
print
"
Failed - email must be @MIT.EDU
"
sys
.
exit
(
-
1
)
...
...
@@ -76,6 +68,13 @@ if raw_input('Create MIT ExternalAuth? [n] ').lower()=='y':
sys
.
exit
(
-
1
)
make_eamap
=
True
password
=
GenPasswd
(
12
)
# get name from kerberos
kname
=
os
.
popen
(
"
finger %s | grep
'
name:
'"
%
email
).
read
().
strip
().
split
(
'
name:
'
)[
1
].
strip
()
name
=
raw_input
(
'
Full name: [%s]
'
%
kname
).
strip
()
if
name
==
''
:
name
=
kname
print
"
name = %s
"
%
name
else
:
while
True
:
password
=
getpass
()
...
...
@@ -84,6 +83,16 @@ else:
break
print
"
Oops, passwords do not match, please retry
"
while
True
:
email
=
raw_input
(
'
email:
'
)
if
User
.
objects
.
filter
(
email
=
email
):
print
"
email %s already taken
"
%
email
else
:
break
name
=
raw_input
(
'
Full name:
'
)
user
=
User
(
username
=
uname
,
email
=
email
,
is_active
=
True
)
user
.
set_password
(
password
)
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment