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
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
e77137c2
Commit
e77137c2
authored
7 years ago
by
Sofiya Semenova
Browse files
Options
Downloads
Patches
Plain Diff
Don't get the site object unless the message is going to be sent
parent
77100cd4
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/discussion/tasks.py
+2
-2
2 additions, 2 deletions
lms/djangoapps/discussion/tasks.py
with
2 additions
and
2 deletions
lms/djangoapps/discussion/tasks.py
+
2
−
2
View file @
e77137c2
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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