[CORD-2314] Sending timestamps along with redis events instead of dates
Change-Id: I5a204e035a80473388bb85f7489780499cbafa15
diff --git a/xos/core/models/attic/xosbase_header.py b/xos/core/models/attic/xosbase_header.py
index 523dccd..13e628a 100644
--- a/xos/core/models/attic/xosbase_header.py
+++ b/xos/core/models/attic/xosbase_header.py
@@ -15,6 +15,7 @@
import datetime
+import time
import json
import pytz
import inspect
@@ -46,7 +47,10 @@
if isinstance(obj, pytz.tzfile.DstTzInfo):
# json can't serialize DstTzInfo
return str(obj)
- return obj.isoformat() if hasattr(obj, 'isoformat') else obj
+ elif hasattr(obj, 'timetuple'):
+ return time.mktime(obj.timetuple())
+ else:
+ return obj
class StrippedCharField(models.CharField):
""" CharField that strips trailing and leading spaces."""