summaryrefslogtreecommitdiff
path: root/news
diff options
context:
space:
mode:
Diffstat (limited to 'news')
-rw-r--r--news/models.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/news/models.py b/news/models.py
index 95026e1d..2efea579 100644
--- a/news/models.py
+++ b/news/models.py
@@ -1,8 +1,7 @@
from django.db import models
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
-
-from main.utils import utc_now
+from django.utils.timezone import now
class News(models.Model):
@@ -29,13 +28,13 @@ class News(models.Model):
def set_news_fields(sender, **kwargs):
news = kwargs['instance']
- now = utc_now()
- news.last_modified = now
+ current_time = now()
+ news.last_modified = current_time
if not news.postdate:
- news.postdate = now
+ news.postdate = current_time
# http://diveintomark.org/archives/2004/05/28/howto-atom-id
news.guid = 'tag:%s,%s:%s' % (Site.objects.get_current(),
- now.strftime('%Y-%m-%d'), news.get_absolute_url())
+ current_time.strftime('%Y-%m-%d'), news.get_absolute_url())
# connect signals needed to keep cache in line with reality
from main.utils import refresh_latest