diff options
author | Dan McGee <dan@archlinux.org> | 2012-12-27 17:02:40 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-12-27 17:02:40 -0600 |
commit | e68a5073a6e8b9473f726734e0b51fdb0a42c14b (patch) | |
tree | 54155b70de13b217c5a2bbd95a1b193984fd4d69 /devel | |
parent | 2b9519996a47fd1d978ccac36246f0245ad668fb (diff) |
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 'devel')
-rw-r--r-- | devel/migrations/0008_auto__add_field_userprofile_last_modified.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/devel/migrations/0008_auto__add_field_userprofile_last_modified.py b/devel/migrations/0008_auto__add_field_userprofile_last_modified.py index 2695987a..08972e1b 100644 --- a/devel/migrations/0008_auto__add_field_userprofile_last_modified.py +++ b/devel/migrations/0008_auto__add_field_userprofile_last_modified.py @@ -3,12 +3,14 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from pytz import utc class Migration(SchemaMigration): def forwards(self, orm): + default = datetime.datetime(2000, 1, 1, 0, 0).replace(tzinfo=utc) db.add_column('user_profiles', 'last_modified', - self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2000, 1, 1, 0, 0)), + self.gf('django.db.models.fields.DateTimeField')(default=default), keep_default=False) def backwards(self, orm): |