diff options
Diffstat (limited to 'news')
-rw-r--r-- | news/models.py | 7 |
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 |