Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8a18b2c3
Commit
8a18b2c3
authored
Jul 14, 2016
by
e0d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use random rather than unusable so they can be reset
parent
6e7d4cef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
common/djangoapps/student/management/commands/manage_user.py
+5
-2
No files found.
common/djangoapps/student/management/commands/manage_user.py
View file @
8a18b2c3
...
...
@@ -4,7 +4,7 @@ Django users, set/unset permission bits, and associate groups by name.
"""
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth.models
import
Group
from
django.contrib.auth.models
import
Group
,
BaseUserManager
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.db
import
transaction
from
django.utils.translation
import
gettext
as
_
...
...
@@ -81,7 +81,10 @@ class Command(BaseCommand):
)
if
created
:
user
.
set_unusable_password
()
# Set the password to a random, unknown, but usable password
# allowing self-service password resetting. Cases where unusable
# passwords are required, should be explicit, and will be handled below.
user
.
set_password
(
BaseUserManager
()
.
make_random_password
(
25
))
self
.
stderr
.
write
(
_
(
'Created new user: "{}"'
)
.
format
(
user
))
else
:
# NOTE, we will not update the email address of an existing user.
...
...
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