Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Commit

Permalink
Use Django timezone utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar committed Sep 24, 2012
1 parent f4b8ca6 commit adb066e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions piplmesh/panels/horoscope/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import datetime

from django.utils import translation
from django.utils import timezone, translation
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import utc

from piplmesh import panels

Expand Down Expand Up @@ -54,7 +53,7 @@ def get_context(self, context):
})
return context

if datetime.datetime.utcnow().replace(tzinfo=utc) > horoscope.date + datetime.timedelta(days=HOROSCOPE_OBSOLETE):
if timezone.now() > horoscope.date + datetime.timedelta(days=HOROSCOPE_OBSOLETE):
context.update({
'error_obsolete': True,
})
Expand Down

0 comments on commit adb066e

Please sign in to comment.