summaryrefslogtreecommitdiff
path: root/news/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-23 20:19:34 -0500
committerDan McGee <dan@archlinux.org>2012-03-23 20:19:34 -0500
commit822898e57bc6d4e008ef58da309857e9ef8c98e6 (patch)
tree1af0836c927b87e2249628d47cdfefe77c3b18fd /news/models.py
parentea87160c397fe1daf63851f0ed0be146bea79196 (diff)
parent8e10699d53281be53c88a3695de6aa496e084dc6 (diff)
Merge branch 'django14'
Conflicts: templates/releng/result_section.html
Diffstat (limited to 'news/models.py')
-rw-r--r--news/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/news/models.py b/news/models.py
index 33d958e0..95026e1d 100644
--- a/news/models.py
+++ b/news/models.py
@@ -1,9 +1,10 @@
-from datetime import datetime
-
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
+
+
class News(models.Model):
slug = models.SlugField(max_length=255, unique=True)
author = models.ForeignKey(User, related_name='news_author',
@@ -28,7 +29,7 @@ class News(models.Model):
def set_news_fields(sender, **kwargs):
news = kwargs['instance']
- now = datetime.utcnow()
+ now = utc_now()
news.last_modified = now
if not news.postdate:
news.postdate = now