Found one more naive datetime
"""Django admin interface for core models."""
from __future__ import absolute_import
-from datetime import datetime, timedelta
+from datetime import timedelta
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
+from django.utils import timezone
from readthedocs.core.models import UserProfile
from readthedocs.projects.models import Project
@@ -50,7 +51,7 @@ class UserProjectFilter(admin.SimpleListFilter):
if self.value() == self.PROJECT_BUILT:
return queryset.filter(projects__versions__built=True)
if self.value() == self.PROJECT_RECENT:
- recent_date = datetime.today() - timedelta(days=365)
+ recent_date = timezone.now() - timedelta(days=365)
return queryset.filter(projects__builds__date__gt=recent_date)
