Index: electronic_mail.py |
=================================================================== |
--- a/electronic_mail.py |
+++ b/electronic_mail.py |
@@ -261,6 +261,8 @@ |
:param mailbox: ID of the mailbox |
""" |
header_obj = self.pool.get('electronic_mail.header') |
+ email_date = mail.get('date') and datetime.fromtimestamp( |
+ mktime(parsedate(mail.get('date')))) |
ced
2011/03/23 10:42:16
Will it be more readable with an if statement
|
values = { |
'mailbox': mailbox, |
'from_': mail.get('from'), |
@@ -269,9 +271,7 @@ |
'cc': mail.get('cc'), |
'bcc': mail.get('bcc'), |
'subject': mail.get('subject'), |
- 'date': mail.get('date') and datetime.fromtimestamp( |
- mktime(parsedate(mail.get('date'))) |
- ) or False, |
+ 'date': email_date, |
'message_id': mail.get('message-id'), |
'in_reply_to': mail.get('in-reply-to'), |
'email': mail.as_string(), |