summaryrefslogtreecommitdiffstats
path: root/news
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-27 17:02:40 -0600
committerDan McGee <dan@archlinux.org>2012-12-27 17:02:40 -0600
commite68a5073a6e8b9473f726734e0b51fdb0a42c14b (patch)
tree54155b70de13b217c5a2bbd95a1b193984fd4d69 /news
parent2b9519996a47fd1d978ccac36246f0245ad668fb (diff)
downloadarchweb-e68a5073a6e8b9473f726734e0b51fdb0a42c14b.tar.gz
archweb-e68a5073a6e8b9473f726734e0b51fdb0a42c14b.zip
Fix "RuntimeWarning: DateTimeField received a naive datetime" warnings
When running tests, we can find old migrations that didn't use datetime objects with timezones attached. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'news')
-rw-r--r--news/migrations/0003_new_date_columns_precision.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/news/migrations/0003_new_date_columns_precision.py b/news/migrations/0003_new_date_columns_precision.py
index 21b64443..1c97f488 100644
--- a/news/migrations/0003_new_date_columns_precision.py
+++ b/news/migrations/0003_new_date_columns_precision.py
@@ -1,14 +1,14 @@
# encoding: utf-8
-import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from django.utils.timezone import now
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'News.last_modified'
- db.add_column('news', 'last_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime.now(), db_index=True, blank=True), keep_default=False)
+ db.add_column('news', 'last_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=now(), db_index=True, blank=True), keep_default=False)
# Changing field 'News.postdate'
db.alter_column('news', 'postdate', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True))
# Adding index on 'News', fields ['postdate']