Skip to content
Snippets Groups Projects
Unverified Commit 3619ec0d authored by Dillon-Dumesnil's avatar Dillon-Dumesnil Committed by GitHub
Browse files

Merge pull request #19130 from edx/ddumesnil/pw_rollout_messaging

Improving the password complexity rollout messaging per UX's recommen…
parents 78c73595 5910601c
No related merge requests found
...@@ -7,6 +7,7 @@ import pytz ...@@ -7,6 +7,7 @@ import pytz
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext as _ 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.date_utils import DEFAULT_SHORT_DATE_FORMAT, strftime_localized
from util.password_policy_validators import validate_password from util.password_policy_validators import validate_password
...@@ -70,25 +71,35 @@ def enforce_compliance_on_login(user, password): ...@@ -70,25 +71,35 @@ def enforce_compliance_on_login(user, password):
now = datetime.now(pytz.UTC) now = datetime.now(pytz.UTC)
if now >= deadline: if now >= deadline:
raise NonCompliantPasswordException( raise NonCompliantPasswordException(
_capitalize_first(_( HTML(_(
'{platform_name} now requires more complex passwords. Your current password does not meet the new ' '{strong_tag_open}We recently changed our password requirements{strong_tag_close}{break_line_tag}'
'requirements. A password reset e-mail has been sent to the address associated with this account.' 'Your current password does not meet the new security requirements. We just sent a password-reset '
'Thank you for helping us keep your data safe.' 'message to the email address associated with this account. Thank you for helping us keep your data '
).format( 'safe.'
platform_name=settings.PLATFORM_NAME )).format(
)) strong_tag_open=HTML('<strong>'),
strong_tag_close=HTML('</strong>'),
break_line_tag=HTML('<br/>'),
)
) )
else: else:
raise NonCompliantPasswordWarning( raise NonCompliantPasswordWarning(
_capitalize_first(_( HTML(_(
'{platform_name} now requires more complex passwords. Your current password does not meet the new ' '{strong_tag_open}Required Action: Please update your password{strong_tag_close}{break_line_tag}'
'requirements. You must change your password by {deadline} to be able to continue using the site. ' 'As of {deadline}, {platform_name} will require all learners to have complex passwords. Your current '
'To change your password, select the dropdown menu icon next to your username, then select "Account". ' 'password does not meet these requirements. To reset your password, go to to '
'You can reset your password from this page. Thank you for helping us keep your data safe.' '{anchor_tag_open}Account Settings{anchor_tag_close}.'
).format( )).format(
strong_tag_open=HTML('<strong>'),
strong_tag_close=HTML('</strong>'),
break_line_tag=HTML('<br/>'),
platform_name=settings.PLATFORM_NAME, 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>')
)
) )
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment