summaryrefslogtreecommitdiff
path: root/news
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
parentea87160c397fe1daf63851f0ed0be146bea79196 (diff)
parent8e10699d53281be53c88a3695de6aa496e084dc6 (diff)
Merge branch 'django14'
Conflicts: templates/releng/result_section.html
Diffstat (limited to 'news')
-rw-r--r--news/models.py7
-rw-r--r--news/urls.py2
2 files changed, 5 insertions, 4 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
diff --git a/news/urls.py b/news/urls.py
index d938ef58..10020f31 100644
--- a/news/urls.py
+++ b/news/urls.py
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import patterns
+from django.conf.urls import patterns
urlpatterns = patterns('news.views',
(r'^$', 'news_list', {}, 'news-list'),