Commit 9c8cadac by Peter Fogg

Merge pull request #10894 from edx/hotfix/2015-12-08

Fix Unicode errors in financial assistance.
parents bce1c66b a609e074
...@@ -205,8 +205,8 @@ def _record_feedback_in_zendesk( ...@@ -205,8 +205,8 @@ def _record_feedback_in_zendesk(
zendesk_api = _ZendeskApi() zendesk_api = _ZendeskApi()
additional_info_string = ( additional_info_string = (
"Additional information:\n\n" + u"Additional information:\n\n" +
"\n".join("%s: %s" % (key, value) for (key, value) in additional_info.items() if value is not None) u"\n".join(u"%s: %s" % (key, value) for (key, value) in additional_info.items() if value is not None)
) )
# Tag all issues with LMS to distinguish channel in Zendesk; requested by student support team # Tag all issues with LMS to distinguish channel in Zendesk; requested by student support team
......
...@@ -184,7 +184,7 @@ class ViewsTestCase(ModuleStoreTestCase): ...@@ -184,7 +184,7 @@ class ViewsTestCase(ModuleStoreTestCase):
""" """
def setUp(self): def setUp(self):
super(ViewsTestCase, self).setUp() super(ViewsTestCase, self).setUp()
self.course = CourseFactory.create() self.course = CourseFactory.create(display_name=u'teꜱᴛ course')
self.chapter = ItemFactory.create(category='chapter', parent_location=self.course.location) self.chapter = ItemFactory.create(category='chapter', parent_location=self.course.location)
self.section = ItemFactory.create(category='sequential', parent_location=self.chapter.location, due=datetime(2013, 9, 18, 11, 30, 00)) self.section = ItemFactory.create(category='sequential', parent_location=self.chapter.location, due=datetime(2013, 9, 18, 11, 30, 00))
self.vertical = ItemFactory.create(category='vertical', parent_location=self.section.location) self.vertical = ItemFactory.create(category='vertical', parent_location=self.section.location)
...@@ -434,7 +434,7 @@ class ViewsTestCase(ModuleStoreTestCase): ...@@ -434,7 +434,7 @@ class ViewsTestCase(ModuleStoreTestCase):
'location': unicode(usage_key), 'location': unicode(usage_key),
}) })
response = self.client.get(url) response = self.client.get(url)
response_content = HTMLParser().unescape(response.content) response_content = HTMLParser().unescape(response.content.decode('utf-8'))
# We have update the state 4 times: twice to change content, and twice # We have update the state 4 times: twice to change content, and twice
# to set the scores. We'll check that the identifying content from each is # to set the scores. We'll check that the identifying content from each is
...@@ -547,7 +547,7 @@ class ViewsTestCase(ModuleStoreTestCase): ...@@ -547,7 +547,7 @@ class ViewsTestCase(ModuleStoreTestCase):
self.assertEqual( self.assertEqual(
ticket_subject, ticket_subject,
'Financial assistance request for learner {username} in course {course}'.format( u'Financial assistance request for learner {username} in course {course}'.format(
username=username, username=username,
course=self.course.display_name course=self.course.display_name
) )
......
...@@ -1477,22 +1477,22 @@ def financial_assistance_request(request): ...@@ -1477,22 +1477,22 @@ def financial_assistance_request(request):
ip_address = get_ip(request) ip_address = get_ip(request)
except ValueError: except ValueError:
# Thrown if JSON parsing fails # Thrown if JSON parsing fails
return HttpResponseBadRequest('Could not parse request JSON.') return HttpResponseBadRequest(u'Could not parse request JSON.')
except InvalidKeyError: except InvalidKeyError:
# Thrown if course key parsing fails # Thrown if course key parsing fails
return HttpResponseBadRequest('Could not parse request course key.') return HttpResponseBadRequest(u'Could not parse request course key.')
except KeyError as err: except KeyError as err:
# Thrown if fields are missing # Thrown if fields are missing
return HttpResponseBadRequest('The field {} is required.'.format(err.message)) return HttpResponseBadRequest(u'The field {} is required.'.format(err.message))
zendesk_submitted = _record_feedback_in_zendesk( zendesk_submitted = _record_feedback_in_zendesk(
legal_name, legal_name,
email, email,
'Financial assistance request for learner {username} in course {course_name}'.format( u'Financial assistance request for learner {username} in course {course_name}'.format(
username=username, username=username,
course_name=course.display_name course_name=course.display_name
), ),
'Financial Assistance Request', u'Financial Assistance Request',
{'course_id': course_id}, {'course_id': course_id},
# Send the application as additional info on the ticket so # Send the application as additional info on the ticket so
# that it is not shown when support replies. This uses # that it is not shown when support replies. This uses
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment