Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
2d625f67
Commit
2d625f67
authored
Apr 24, 2017
by
tasawernawaz
Committed by
Tasawer Nawaz
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to send comment emails to the person entering the comments
ECOM-7727
parent
75c7325d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
course_discovery/apps/publisher_comments/emails.py
+5
-0
course_discovery/apps/publisher_comments/tests/test_emails.py
+3
-3
No files found.
course_discovery/apps/publisher_comments/emails.py
View file @
2d625f67
...
...
@@ -63,6 +63,11 @@ def send_email_for_comment(comment, created=False):
course_name
=
course
.
title
to_addresses
=
course
.
get_course_users_emails
()
# remove email of comment owner if exists
if
comment
.
user_email
in
to_addresses
:
to_addresses
.
remove
(
comment
.
user_email
)
from_address
=
settings
.
PUBLISHER_FROM_EMAIL
context
=
{
...
...
course_discovery/apps/publisher_comments/tests/test_emails.py
View file @
2d625f67
...
...
@@ -126,7 +126,7 @@ class CommentsEmailTests(TestCase):
def
assert_comment_email_sent
(
self
,
content_object
,
comment
,
object_path
,
subject
):
""" DRY method to assert send email data"""
self
.
assertEqual
([
self
.
user
.
email
,
self
.
user
_2
.
email
],
mail
.
outbox
[
0
]
.
to
)
self
.
assertEqual
([
self
.
user_2
.
email
],
mail
.
outbox
[
0
]
.
to
)
self
.
assertEqual
(
str
(
mail
.
outbox
[
0
]
.
subject
),
subject
)
body
=
mail
.
outbox
[
0
]
.
body
.
strip
()
if
isinstance
(
content_object
,
CourseRun
):
...
...
@@ -160,7 +160,7 @@ class CommentsEmailTests(TestCase):
)
self
.
create_comment
(
content_object
=
self
.
course_run
)
self
.
assertEqual
(
len
(
mail
.
outbox
),
1
)
self
.
assertEqual
([
self
.
user
.
email
,
self
.
user
_2
.
email
,
user_4
.
email
,
user_5
.
email
],
mail
.
outbox
[
0
]
.
to
)
self
.
assertEqual
([
self
.
user_2
.
email
,
user_4
.
email
,
user_5
.
email
],
mail
.
outbox
[
0
]
.
to
)
def
test_email_for_roles_only
(
self
):
""" Verify the emails send to the course roles users even if groups has no users. """
...
...
@@ -255,7 +255,7 @@ class CommentsEmailTests(TestCase):
def
create_comment
(
self
,
content_object
,
comment_type
=
CommentTypeChoices
.
Default
):
""" DRY method to create the comment for a given content type."""
return
CommentFactory
(
content_object
=
content_object
,
user
=
self
.
user
,
site
=
self
.
site
,
content_object
=
content_object
,
user
=
self
.
user
,
site
=
self
.
site
,
user_email
=
self
.
user
.
email
,
comment_type
=
comment_type
)
...
...
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