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
14c1f5bd
Unverified
Commit
14c1f5bd
authored
Nov 20, 2017
by
Sofiya Semenova
Committed by
GitHub
Nov 20, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16616 from edx/sofiya/clean
Don't get the site object unless the message is going to be sent
parents
b78d5061
e77137c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lms/djangoapps/discussion/tasks.py
+2
-2
No files found.
lms/djangoapps/discussion/tasks.py
View file @
14c1f5bd
...
...
@@ -3,7 +3,6 @@ Defines asynchronous celery task for sending email notification (through edx-ace
pertaining to new discussion forum comments.
"""
import
logging
from
urllib
import
urlencode
from
urlparse
import
urljoin
from
celery
import
task
...
...
@@ -41,8 +40,9 @@ class ResponseNotification(MessageType):
@task
(
base
=
LoggedTask
,
routing_key
=
ROUTING_KEY
)
def
send_ace_message
(
context
):
context
[
'course_id'
]
=
CourseKey
.
from_string
(
context
[
'course_id'
])
context
[
'site'
]
=
Site
.
objects
.
get
(
id
=
context
[
'site_id'
])
if
_should_send_message
(
context
):
context
[
'site'
]
=
Site
.
objects
.
get
(
id
=
context
[
'site_id'
])
thread_author
=
User
.
objects
.
get
(
id
=
context
[
'thread_author_id'
])
middleware_classes
=
[
CurrentRequestUserMiddleware
,
...
...
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