summaryrefslogtreecommitdiff
path: root/news/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-24 09:19:48 -0500
committerDan McGee <dan@archlinux.org>2012-07-24 19:57:20 -0500
commitc0bf9e20660cfae7ea8994472555bba23398b598 (patch)
tree889351fc02d4930233acf3dace3ececda4833c88 /news/models.py
parent61b4098c611592d62b40a9ee941976a869dff4fc (diff)
Remove custom utc_now() function, use django.utils.timezone.now()
This was around from the time when we handled timezones sanely and Django did not; now that we are on 1.4 we no longer need our own code to handle this. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'news/models.py')
-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