diff options
author | mnandri <mnandri@eumguccion.corporate.thoughtworks.com> | 2015-12-07 16:53:39 +0100 |
---|---|---|
committer | mnandri <mnandri@eumguccion.corporate.thoughtworks.com> | 2015-12-07 16:53:49 +0100 |
commit | fa1299aca064d2ac347a3e14d4c2169335a8f40c (patch) | |
tree | 52dd015527cd7f30c11ee84de5e5523954fefb0f /service/pixelated/resources | |
parent | 6df57ef709f0a19e467a5a88bc854f4e5f8e00f7 (diff) |
#454 added utf-8 encoding on message body, and corresponding query search term
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/mails_resource.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/service/pixelated/resources/mails_resource.py b/service/pixelated/resources/mails_resource.py index 34dd042a..613c5e6f 100644 --- a/service/pixelated/resources/mails_resource.py +++ b/service/pixelated/resources/mails_resource.py @@ -7,10 +7,9 @@ from twisted.web.resource import Resource from twisted.web import server from twisted.internet import defer from twisted.python.log import err -from leap.common.events import ( - register, - catalog as events -) +from leap.common import events + +from pixelated.utils import to_unicode class MailsUnreadResource(Resource): @@ -120,7 +119,7 @@ class MailsResource(Resource): delivery_error_mail = InputMail.delivery_error_template(delivery_address=event.content) self._mail_service.mailboxes.inbox.add(delivery_error_mail) - register(events.SMTP_SEND_MESSAGE_ERROR, callback=on_error) + events.register(events.catalog.SMTP_SEND_MESSAGE_ERROR, callback=on_error) def __init__(self, mail_service, draft_service): Resource.__init__(self) @@ -136,7 +135,8 @@ class MailsResource(Resource): def render_GET(self, request): query, window_size, page = request.args.get('q')[0], request.args.get('w')[0], request.args.get('p')[0] - d = self._mail_service.mails(query, window_size, page) + unicode_query = to_unicode(query) + d = self._mail_service.mails(unicode_query, window_size, page) d.addCallback(lambda (mails, total): { "stats": { |