diff options
author | NavaL <ayoyo@thoughtworks.com> | 2016-03-02 13:22:47 +0100 |
---|---|---|
committer | NavaL <ayoyo@thoughtworks.com> | 2016-03-02 13:22:47 +0100 |
commit | 055e7f0f12f585f138063a562d4db5b02e6d6078 (patch) | |
tree | 2b9e81e676705ad2334e98e1bb4a5ea220251100 | |
parent | e74cf4898f0274de22d5e11186af664f9f5f2003 (diff) |
adding default date if not given in the mail header, for search index -- fixing build
-rw-r--r-- | service/pixelated/adapter/mailstore/leap_mailstore.py | 1 | ||||
-rw-r--r-- | service/pixelated/adapter/search/__init__.py | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py index 975bcc5c..cd4cb5b8 100644 --- a/service/pixelated/adapter/mailstore/leap_mailstore.py +++ b/service/pixelated/adapter/mailstore/leap_mailstore.py @@ -27,6 +27,7 @@ from pixelated.adapter.mailstore.mailstore import MailStore, underscore_uuid from pixelated.adapter.model.mail import Mail, InputMail from pixelated.support import log_time_deferred from pixelated.support.functional import to_unicode +from pixelated.support import date MIME_PGP_KEY = 'application/pgp-keys' diff --git a/service/pixelated/adapter/search/__init__.py b/service/pixelated/adapter/search/__init__.py index e137b392..3ec6532b 100644 --- a/service/pixelated/adapter/search/__init__.py +++ b/service/pixelated/adapter/search/__init__.py @@ -30,6 +30,7 @@ from whoosh.writing import AsyncWriter from whoosh import sorting from pixelated.support.functional import unique, to_unicode import traceback +from pixelated.support import date class SearchEngine(object): @@ -128,7 +129,7 @@ class SearchEngine(object): index_data = { 'sender': self._empty_string_to_none(header.get('from', '')), 'subject': self._empty_string_to_none(header.get('subject', '')), - 'date': self._format_utc_integer(header.get('date', '')), + 'date': self._format_utc_integer(header.get('date', date.mail_date_now())), 'to': self._format_recipient(header, 'to'), 'cc': self._format_recipient(header, 'cc'), 'bcc': self._format_recipient(header, 'bcc'), |