Commit 95d9db9e authored by Ivan Tyagov's avatar Ivan Tyagov

Sometimes set start_date for email document do not conforms to RFC 2822 so...

Sometimes set start_date for email document do not conforms to RFC 2822 so make sure conversion is not tried for incorrect dates.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22822 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e4c5b54b
......@@ -256,9 +256,11 @@ class EmailDocument(File, TextDocument):
return self._baseGetStartDate(default)
date_string = self.getContentInformation().get('Date', None)
if date_string:
time = mktime(parsedate(date_string))
if time:
return DateTime(time)
parsed_date_string = parsedate(date_string)
if parsed_date_string is not None:
time = mktime(parsed_date_string)
if time:
return DateTime(time)
return self.getCreationDate()
security.declareProtected(Permissions.AccessContentsInformation, 'getTextContent')
......
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