Factor out string escaping code

So that it only lives in one place.
This commit is contained in:
Chris Hill-Scott
2017-11-06 13:22:46 +00:00
parent f6950ae987
commit f329e138cd
3 changed files with 8 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ from app.utils import (
FAILURE_STATUSES,
REQUESTED_STATUSES,
Spreadsheet,
unescape_string,
)
@@ -204,7 +205,7 @@ def get_inbox_partials(service_id):
for message in messages_to_show
}:
message.update({
'content': bytes(message['content'], 'utf-8').decode('unicode_escape')
'content': unescape_string(message['content'])
})
messages_to_show.append(message)