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
95800be0
Commit
95800be0
authored
Jul 20, 2016
by
Edward Zarecor
Committed by
GitHub
Jul 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12999 from edx/e0d/random-passwords
use random rather than unusable so they can be reset
parents
9d747fa6
8a18b2c3
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 @
95800be0
...
...
@@ -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