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
cb88c1dd
Commit
cb88c1dd
authored
Feb 06, 2015
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ajax login when advanced security check is on for NoneType user.
TNL-1352
parent
4a5679b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
common/djangoapps/student/tests/test_login.py
+8
-0
common/djangoapps/student/views.py
+1
-1
No files found.
common/djangoapps/student/tests/test_login.py
View file @
cb88c1dd
...
...
@@ -78,6 +78,14 @@ class LoginTest(TestCase):
value
=
'Email or password is incorrect'
)
self
.
_assert_audit_log
(
mock_audit_log
,
'warning'
,
[
u'Login failed'
,
u'Unknown user email'
,
nonexistent_email
])
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ADVANCED_SECURITY'
:
True
})
def
test_login_fail_incorrect_email_with_advanced_security
(
self
):
nonexistent_email
=
u'not_a_user@edx.org'
response
,
mock_audit_log
=
self
.
_login_response
(
nonexistent_email
,
'test_password'
)
self
.
_assert_response
(
response
,
success
=
False
,
value
=
'Email or password is incorrect'
)
self
.
_assert_audit_log
(
mock_audit_log
,
'warning'
,
[
u'Login failed'
,
u'Unknown user email'
,
nonexistent_email
])
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'SQUELCH_PII_IN_LOGS'
:
True
})
def
test_login_fail_no_user_exists_no_pii
(
self
):
nonexistent_email
=
u'not_a_user@edx.org'
...
...
common/djangoapps/student/views.py
View file @
cb88c1dd
...
...
@@ -1034,7 +1034,7 @@ def login_user(request, error=""): # pylint: disable-msg=too-many-statements,un
})
# TODO: this should be status code 429 # pylint: disable=fixme
# see if the user must reset his/her password due to any policy settings
if
PasswordHistory
.
should_user_reset_password_now
(
user_found_by_email_lookup
):
if
user_found_by_email_lookup
and
PasswordHistory
.
should_user_reset_password_now
(
user_found_by_email_lookup
):
return
JsonResponse
({
"success"
:
False
,
"value"
:
_
(
'Your password has expired due to password policy on this account. You must '
...
...
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