From dad66ad5a2c8a9645e0127e09283082f3c439a28 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Mon, 27 May 2013 20:52:03 +0200 Subject: Rework the display of email datetimes using timezones --- hyperkitty/views/accounts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hyperkitty/views/accounts.py') diff --git a/hyperkitty/views/accounts.py b/hyperkitty/views/accounts.py index 42edd49..43ee5c6 100644 --- a/hyperkitty/views/accounts.py +++ b/hyperkitty/views/accounts.py @@ -31,6 +31,7 @@ from django.contrib.auth.models import User from django.contrib.auth.views import login as django_login_view from django.shortcuts import render, redirect from django.utils.http import is_safe_url +from django.utils.timezone import utc #from django.utils.translation import gettext as _ from social_auth.backends import SocialAuthBackend @@ -189,7 +190,7 @@ def last_views(request): last_views = last_views_paginator.page(last_views_paginator.num_pages) for last_view in last_views: thread = store.get_thread(last_view.list_address, last_view.threadid) - if thread.date_active > last_view.view_date: + if thread.date_active.replace(tzinfo=utc) > last_view.view_date: # small optimization: only query the replies if necessary # XXX: Storm-specific (count method) thread.unread = thread.replies_after(last_view.view_date).count() -- cgit