diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2013-05-27 21:17:57 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2013-05-27 21:17:57 +0200 |
commit | d0c38e1a55e60699416470cb38c4e6675a9383c6 (patch) | |
tree | 458b8602d655b71995f914bec116377aebdfb0da | |
parent | 91c10e88899497c76428f101667c3ab02bb7fe99 (diff) | |
download | kittystore-d0c38e1a55e60699416470cb38c4e6675a9383c6.tar.gz kittystore-d0c38e1a55e60699416470cb38c4e6675a9383c6.tar.xz kittystore-d0c38e1a55e60699416470cb38c4e6675a9383c6.zip |
Incoming emails with no dates are in UTC
-rw-r--r-- | kittystore/storm/store.py | 2 | ||||
-rw-r--r-- | kittystore/test/test_storm_store.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kittystore/storm/store.py b/kittystore/storm/store.py index 4afd463..9c39c70 100644 --- a/kittystore/storm/store.py +++ b/kittystore/storm/store.py @@ -120,7 +120,7 @@ class StormStore(object): msg_date = parsedate(message.get("Date")) if msg_date is None: # Absent or unparseable date - msg_date = datetime.datetime.now() + msg_date = datetime.datetime.utcnow() utcoffset = msg_date.utcoffset() if msg_date.tzinfo is not None: msg_date = msg_date.astimezone(tzutc()).replace(tzinfo=None) diff --git a/kittystore/test/test_storm_store.py b/kittystore/test/test_storm_store.py index b33304f..b3d2903 100644 --- a/kittystore/test/test_storm_store.py +++ b/kittystore/test/test_storm_store.py @@ -35,7 +35,7 @@ class TestStormStore(unittest.TestCase): msg["From"] = "dummy@example.com" msg["Message-ID"] = "<dummy>" msg.set_payload("Dummy message") - now = datetime.datetime.now() + now = datetime.datetime.utcnow() try: self.store.add_to_list(FakeList("example-list"), msg) except IntegrityError, e: |