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
c9b0e12d
Commit
c9b0e12d
authored
May 13, 2016
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use markupspace for escaping
parent
91ae60f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lms/djangoapps/bulk_email/tasks.py
+2
-2
lms/djangoapps/bulk_email/tests/test_email.py
+2
-2
No files found.
lms/djangoapps/bulk_email/tasks.py
View file @
c9b0e12d
...
...
@@ -3,7 +3,6 @@
This module contains celery task functions for handling the sending of bulk email
to a course.
"""
import
cgi
from
collections
import
Counter
import
json
import
logging
...
...
@@ -25,6 +24,7 @@ from boto.ses.exceptions import (
SESIllegalAddressError
,
)
from
boto.exception
import
AWSConnectionError
from
markupsafe
import
escape
from
celery
import
task
,
current_task
# pylint: disable=no-name-in-module
from
celery.states
import
SUCCESS
,
FAILURE
,
RETRY
# pylint: disable=no-name-in-module, import-error
...
...
@@ -434,7 +434,7 @@ def _get_source_address(course_id, course_title, truncate=True):
# It seems that this value is also escaped when set out to amazon, judging
# from our logs
escaped_encoded_from_addr
=
cgi
.
escape
(
encoded_from_addr
)
escaped_encoded_from_addr
=
escape
(
encoded_from_addr
)
if
len
(
escaped_encoded_from_addr
)
>=
320
and
truncate
:
from_addr
=
format_address
(
course_name
)
...
...
lms/djangoapps/bulk_email/tests/test_email.py
View file @
c9b0e12d
...
...
@@ -2,8 +2,8 @@
"""
Unit tests for sending course email
"""
import
cgi
import
json
from
markupsafe
import
escape
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
import
os
...
...
@@ -344,7 +344,7 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase)
__
,
encoded_unexpected_from_addr
=
forbid_multi_line_headers
(
"from"
,
unexpected_from_addr
,
'utf-8'
)
escaped_encoded_unexpected_from_addr
=
cgi
.
escape
(
encoded_unexpected_from_addr
)
escaped_encoded_unexpected_from_addr
=
escape
(
encoded_unexpected_from_addr
)
# it's shorter than 320 characters when just encoded
self
.
assertEqual
(
len
(
encoded_unexpected_from_addr
),
318
)
...
...
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