Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
05c5ac34
Commit
05c5ac34
authored
12 years ago
by
David Ormsbee
Browse files
Options
Downloads
Patches
Plain Diff
Allow people who haven't activated to reset their password.
parent
bb50402b
No related branches found
Branches containing commit
Tags
release-2020-07-14-18.01
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/student/views.py
+11
-4
11 additions, 4 deletions
common/djangoapps/student/views.py
with
11 additions
and
4 deletions
common/djangoapps/student/views.py
+
11
−
4
View file @
05c5ac34
...
...
@@ -517,6 +517,17 @@ def password_reset(request):
'''
Attempts to send a password reset e-mail.
'''
if
request
.
method
!=
"
POST
"
:
raise
Http404
# By default, Django doesn't allow Users with is_active = False to reset their passwords,
# but this bites people who signed up a long time ago, never activated, and forgot their
# password. So for their sake, we'll auto-activate a user for whome password_reset is called.
try
:
user
=
User
.
objects
.
get
(
email
=
request
.
POST
[
'
email
'
])
user
.
is_active
=
True
user
.
save
()
except
:
log
.
exception
(
"
Tried to auto-activate user to enable password reset, but failed.
"
)
form
=
PasswordResetForm
(
request
.
POST
)
if
form
.
is_valid
():
form
.
save
(
use_https
=
request
.
is_secure
(),
...
...
@@ -541,10 +552,6 @@ def reactivation_email(request):
return
HttpResponse
(
json
.
dumps
({
'
success
'
:
False
,
'
error
'
:
'
No inactive user with this e-mail exists
'
}))
if
user
.
is_active
:
return
HttpResponse
(
json
.
dumps
({
'
success
'
:
False
,
'
error
'
:
'
User is already active
'
}))
reg
=
Registration
.
objects
.
get
(
user
=
user
)
reg
.
register
(
user
)
...
...
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