From b51d64d8e7ce056505affb8aa4d6678f2a16df66 Mon Sep 17 00:00:00 2001 From: zhengxie Date: Fri, 31 Oct 2014 16:40:10 +0800 Subject: [PATCH] [api2] Fix issue in python 2.6 when calling events --- seahub/api2/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seahub/api2/views.py b/seahub/api2/views.py index 0bb2a37b62..b1fdf275e7 100644 --- a/seahub/api2/views.py +++ b/seahub/api2/views.py @@ -2538,7 +2538,8 @@ class EventsView(APIView): epoch = datetime.datetime(1970, 1, 1) local = utc_to_local(e.timestamp) - d['time'] = (local - epoch).total_seconds() + time_diff = local - epoch + d['time'] = time_diff.seconds + (time_diff.days * 24 * 3600) d['nick'] = email2nickname(d['author'])