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
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
5910601c
Commit
5910601c
authored
6 years ago
by
Dillon Dumesnil
Browse files
Options
Downloads
Patches
Plain Diff
Improving the password complexity rollout messaging per UX's recommendations
parent
75a739e2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/password_policy/compliance.py
+26
-15
26 additions, 15 deletions
openedx/core/djangoapps/password_policy/compliance.py
with
26 additions
and
15 deletions
openedx/core/djangoapps/password_policy/compliance.py
+
26
−
15
View file @
5910601c
...
...
@@ -7,6 +7,7 @@ import pytz
from
django.conf
import
settings
from
django.utils.translation
import
ugettext
as
_
from
openedx.core.djangolib.markup
import
HTML
from
util.date_utils
import
DEFAULT_SHORT_DATE_FORMAT
,
strftime_localized
from
util.password_policy_validators
import
validate_password
...
...
@@ -70,25 +71,35 @@ def enforce_compliance_on_login(user, password):
now
=
datetime
.
now
(
pytz
.
UTC
)
if
now
>=
deadline
:
raise
NonCompliantPasswordException
(
_capitalize_first
(
_
(
'
{platform_name} now requires more complex passwords. Your current password does not meet the new
'
'
requirements. A password reset e-mail has been sent to the address associated with this account.
'
'
Thank you for helping us keep your data safe.
'
).
format
(
platform_name
=
settings
.
PLATFORM_NAME
))
HTML
(
_
(
'
{strong_tag_open}We recently changed our password requirements{strong_tag_close}{break_line_tag}
'
'
Your current password does not meet the new security requirements. We just sent a password-reset
'
'
message to the email address associated with this account. Thank you for helping us keep your data
'
'
safe.
'
)).
format
(
strong_tag_open
=
HTML
(
'
<strong>
'
),
strong_tag_close
=
HTML
(
'
</strong>
'
),
break_line_tag
=
HTML
(
'
<br/>
'
),
)
)
else
:
raise
NonCompliantPasswordWarning
(
_capitalize_first
(
_
(
'
{platform_name} now requires more complex passwords. Your current password does not meet the new
'
'
requirements. You must change your password by {deadline} to be able to continue using the site.
'
'
To change your password, select the dropdown menu icon next to your username, then select
"
Account
"
.
'
'
You can reset your password from this page. Thank you for helping us keep your data safe.
'
).
format
(
HTML
(
_
(
'
{strong_tag_open}Required Action: Please update your password{strong_tag_close}{break_line_tag}
'
'
As of {deadline}, {platform_name} will require all learners to have complex passwords. Your current
'
'
password does not meet these requirements. To reset your password, go to to
'
'
{anchor_tag_open}Account Settings{anchor_tag_close}.
'
)).
format
(
strong_tag_open
=
HTML
(
'
<strong>
'
),
strong_tag_close
=
HTML
(
'
</strong>
'
),
break_line_tag
=
HTML
(
'
<br/>
'
),
platform_name
=
settings
.
PLATFORM_NAME
,
deadline
=
strftime_localized
(
deadline
,
DEFAULT_SHORT_DATE_FORMAT
)
))
deadline
=
strftime_localized
(
deadline
,
DEFAULT_SHORT_DATE_FORMAT
),
anchor_tag_open
=
HTML
(
'
<a href=
"
{account_settings_url}
"
>
'
).
format
(
account_settings_url
=
settings
.
LMS_ROOT_URL
+
"
/account/settings
"
),
anchor_tag_close
=
HTML
(
'
</a>
'
)
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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