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
2f4774f4
Commit
2f4774f4
authored
Sep 18, 2013
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass status into course_email for tracking retry status.
parent
ffbb228a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
10 deletions
+10
-10
lms/djangoapps/bulk_email/tasks.py
+0
-0
lms/djangoapps/bulk_email/tests/test_email.py
+2
-3
lms/djangoapps/instructor_task/api_helper.py
+1
-2
lms/djangoapps/instructor_task/tasks.py
+4
-2
lms/djangoapps/instructor_task/tasks_helper.py
+2
-2
lms/djangoapps/instructor_task/tests/test_tasks.py
+1
-1
No files found.
lms/djangoapps/bulk_email/tasks.py
View file @
2f4774f4
This diff is collapsed.
Click to expand it.
lms/djangoapps/bulk_email/tests/test_email.py
View file @
2f4774f4
...
...
@@ -34,7 +34,7 @@ class MockCourseEmailResult(object):
def
get_mock_course_email_result
(
self
):
"""Wrapper for mock email function."""
def
mock_course_email_result
(
sent
,
failed
,
output
,
**
kwargs
):
# pylint: disable=W0613
def
mock_course_email_result
(
prev_results
,
sent
,
failed
,
output
,
**
kwargs
):
# pylint: disable=W0613
"""Increments count of number of emails sent."""
self
.
emails_sent
+=
sent
return
True
...
...
@@ -247,7 +247,7 @@ class TestEmailSendFromDashboard(ModuleStoreTestCase):
)
@override_settings
(
EMAILS_PER_TASK
=
3
,
EMAILS_PER_QUERY
=
7
)
@patch
(
'bulk_email.tasks.course_email_result'
)
@patch
(
'bulk_email.tasks.
_
course_email_result'
)
def
test_chunked_queries_send_numerous_emails
(
self
,
email_mock
):
"""
Test sending a large number of emails, to test the chunked querying
...
...
@@ -304,4 +304,3 @@ class TestEmailSendExceptions(ModuleStoreTestCase):
entry
=
InstructorTaskFactory
.
create
(
task_key
=
''
,
task_id
=
'dummy'
)
with
self
.
assertRaises
(
CourseEmail
.
DoesNotExist
):
send_course_email
(
entry
.
id
,
101
,
[],
{
'course_title'
:
'Test'
},
False
)
lms/djangoapps/instructor_task/api_helper.py
View file @
2f4774f4
...
...
@@ -271,4 +271,4 @@ def submit_task(request, task_type, task_class, course_id, task_input, task_key)
task_args
=
[
instructor_task
.
id
,
_get_xmodule_instance_args
(
request
,
task_id
)]
task_class
.
apply_async
(
task_args
,
task_id
=
task_id
)
return
instructor_task
\ No newline at end of file
return
instructor_task
lms/djangoapps/instructor_task/tasks.py
View file @
2f4774f4
...
...
@@ -23,7 +23,6 @@ from celery import task
from
functools
import
partial
from
instructor_task.tasks_helper
import
(
run_main_task
,
perform_module_state_update
,
# perform_delegate_email_batches,
rescore_problem_module_state
,
reset_attempts_module_state
,
delete_problem_module_state
,
...
...
@@ -52,7 +51,10 @@ def rescore_problem(entry_id, xmodule_instance_args):
"""
action_name
=
'rescored'
update_fcn
=
partial
(
rescore_problem_module_state
,
xmodule_instance_args
)
filter_fcn
=
lambda
(
modules_to_update
):
modules_to_update
.
filter
(
state__contains
=
'"done": true'
)
def
filter_fcn
(
modules_to_update
):
return
modules_to_update
.
filter
(
state__contains
=
'"done": true'
)
visit_fcn
=
partial
(
perform_module_state_update
,
update_fcn
,
filter_fcn
)
return
run_main_task
(
entry_id
,
visit_fcn
,
action_name
)
...
...
lms/djangoapps/instructor_task/tasks_helper.py
View file @
2f4774f4
...
...
@@ -52,7 +52,7 @@ def _get_current_task():
return
current_task
def
perform_module_state_update
(
update_fcn
,
filter_fcn
,
entry_id
,
course_id
,
task_input
,
action_name
):
def
perform_module_state_update
(
update_fcn
,
filter_fcn
,
_
entry_id
,
course_id
,
task_input
,
action_name
):
"""
Performs generic update by visiting StudentModule instances with the update_fcn provided.
...
...
@@ -76,7 +76,7 @@ def perform_module_state_update(update_fcn, filter_fcn, entry_id, course_id, tas
'succeeded': number of attempts that "succeeded"
'skipped': number of attempts that "skipped"
'failed': number of attempts that "failed"
'total': number of possible
subtask
s to attempt
'total': number of possible
update
s to attempt
'action_name': user-visible verb to use in status messages. Should be past-tense.
Pass-through of input `action_name`.
'duration_ms': how long the task has (or had) been running.
...
...
lms/djangoapps/instructor_task/tests/test_tasks.py
View file @
2f4774f4
...
...
@@ -23,7 +23,7 @@ from instructor_task.models import InstructorTask
from
instructor_task.tests.test_base
import
InstructorTaskModuleTestCase
from
instructor_task.tests.factories
import
InstructorTaskFactory
from
instructor_task.tasks
import
rescore_problem
,
reset_problem_attempts
,
delete_problem_state
from
instructor_task.tasks_helper
import
UpdateProblemModuleStateError
#, update_problem_module_state
from
instructor_task.tasks_helper
import
UpdateProblemModuleStateError
PROBLEM_URL_NAME
=
"test_urlname"
...
...
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