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
OpenEdx
edx-platform
Commits
7dd95662
Commit
7dd95662
authored
Sep 14, 2017
by
tasawernawaz
Committed by
Dillon Dumesnil
Oct 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix attribute error while reseting password
LEARNER-388
parent
4d9ca696
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
common/djangoapps/student/views.py
+10
-3
No files found.
common/djangoapps/student/views.py
View file @
7dd95662
...
@@ -2629,9 +2629,16 @@ def password_reset_confirm_wrapper(request, uidb36=None, token=None):
...
@@ -2629,9 +2629,16 @@ def password_reset_confirm_wrapper(request, uidb36=None, token=None):
# If password reset was unsuccessful a template response is returned (status_code 200).
# If password reset was unsuccessful a template response is returned (status_code 200).
# Check if form is invalid then show an error to the user.
# Check if form is invalid then show an error to the user.
# Note if password reset was successful we get response redirect (status_code 302).
# Note if password reset was successful we get response redirect (status_code 302).
if
response
.
status_code
==
200
and
not
response
.
context_data
[
'form'
]
.
is_valid
():
if
response
.
status_code
==
200
:
response
.
context_data
[
'err_msg'
]
=
_
(
'Error in resetting your password. Please try again.'
)
form_valid
=
response
.
context_data
[
'form'
]
.
is_valid
()
if
response
.
context_data
[
'form'
]
else
False
return
response
if
not
form_valid
:
log
.
warning
(
u'Unable to reset password for user [
%
s] because form is not valid. '
u'A possible cause is that the user had an invalid reset token'
,
user
.
username
,
)
response
.
context_data
[
'err_msg'
]
=
_
(
'Error in resetting your password. Please try again.'
)
return
response
# get the updated user
# get the updated user
updated_user
=
User
.
objects
.
get
(
id
=
uid_int
)
updated_user
=
User
.
objects
.
get
(
id
=
uid_int
)
...
...
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