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
8dba6c49
Commit
8dba6c49
authored
Apr 09, 2017
by
Salah Alomari
Committed by
Omar Al-Ithawi
Jun 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use platform_name instead of site_name in password reset email subject
parent
d1ede533
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletions
+23
-1
common/djangoapps/student/forms.py
+1
-1
common/djangoapps/student/tests/test_reset_password.py
+18
-0
lms/templates/emails/password_reset_subject.txt
+4
-0
No files found.
common/djangoapps/student/forms.py
View file @
8dba6c49
...
...
@@ -48,7 +48,7 @@ class PasswordResetFormNoActive(PasswordResetForm):
def
save
(
self
,
domain_override
=
None
,
subject_template_name
=
'
registration
/password_reset_subject.txt'
,
subject_template_name
=
'
emails
/password_reset_subject.txt'
,
email_template_name
=
'registration/password_reset_email.html'
,
use_https
=
False
,
token_generator
=
default_token_generator
,
...
...
common/djangoapps/student/tests/test_reset_password.py
View file @
8dba6c49
...
...
@@ -301,3 +301,21 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase):
self
.
assertEquals
(
confirm_kwargs
[
'extra_context'
][
'platform_name'
],
'Fake University'
)
self
.
user
=
User
.
objects
.
get
(
pk
=
self
.
user
.
pk
)
self
.
assertTrue
(
self
.
user
.
is_active
)
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
"Test only valid in LMS"
)
@patch
(
'django.core.mail.send_mail'
)
@ddt.data
(
'Crazy Awesome Site'
,
'edX'
)
def
test_reset_password_email_subject
(
self
,
platform_name
,
send_email
):
"""
Tests that the right platform name is included in
the reset password email subject
"""
with
patch
(
"django.conf.settings.PLATFORM_NAME"
,
platform_name
):
req
=
self
.
request_factory
.
post
(
'/password_reset/'
,
{
'email'
:
self
.
user
.
email
}
)
req
.
user
=
self
.
user
password_reset
(
req
)
subj
,
_
,
_
,
_
=
send_email
.
call_args
[
0
]
self
.
assertIn
(
platform_name
,
subj
)
lms/templates/emails/password_reset_subject.txt
0 → 100644
View file @
8dba6c49
{% load i18n %}
{% autoescape off %}
{% blocktrans %}Password reset on {{ platform_name }}{% endblocktrans %}
{% endautoescape %}
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