summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-28 00:02:40 +0100
committerDan McGee <dan@archlinux.org>2012-12-28 00:02:40 +0100
commite68a5073a6e8b9473f726734e0b51fdb0a42c14b (patch)
tree54155b70de13b217c5a2bbd95a1b193984fd4d69 /main
parent2b9519996a47fd1d978ccac36246f0245ad668fb (diff)
downloadarchweb-e68a5073a6e8b9473f726734e0b51fdb0a42c14b.tar.gz
archweb-e68a5073a6e8b9473f726734e0b51fdb0a42c14b.tar.xz
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 'main')
-rw-r--r--main/migrations/0024_set_initial_flag_date.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/migrations/0024_set_initial_flag_date.py b/main/migrations/0024_set_initial_flag_date.py
index 5026f72..bd00879 100644
--- a/main/migrations/0024_set_initial_flag_date.py
+++ b/main/migrations/0024_set_initial_flag_date.py
@@ -1,14 +1,14 @@
# encoding: utf-8
-import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
+from django.utils.timezone import now
class Migration(DataMigration):
def forwards(self, orm):
orm.Package.objects.filter(needupdate=False).update(flag_date=None)
- orm.Package.objects.filter(needupdate=True).update(flag_date=datetime.datetime.now())
+ orm.Package.objects.filter(needupdate=True).update(flag_date=now())
def backwards(self, orm):
orm.Package.objects.filter(flag_date__isnull=True).update(needupdate=False)