Browse files

Fix EntryToday view when USE_TZ is set to False #233

  • Loading branch information...
1 parent 14d31a4 commit 6256c75da77cbc87e2de633de31bb41fe624a968 @Fantomas42 committed Apr 29, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 zinnia/views/archives.py
View
6 zinnia/views/archives.py
@@ -99,6 +99,8 @@ def get_dated_items(self):
And defines self.year/month/day for
EntryQuerysetArchiveTemplateResponseMixin.
"""
- today = timezone.localtime(timezone.now()).date()
- self.year, self.month, self.day = today.isoformat().split('-')
+ today = timezone.now()
+ if timezone.is_aware(today):
+ today = timezone.localtime(today)
+ self.year, self.month, self.day = today.date().isoformat().split('-')
return self._get_dated_items(today)

0 comments on commit 6256c75

Please sign in to comment.