Skip to content

Commit c6bc6bc

Browse files
committed
Merge pull request rpkilby#85 from bradyoo/south
Setting JSONField as String breaks during South data-migration
2 parents 6aca424 + 9f7e227 commit c6bc6bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jsonfield/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def pre_init(self, value, obj):
7272
# Make sure the primary key actually exists on the object before
7373
# checking if it's empty. This is a special case for South datamigrations
7474
# see: https://github.com/bradjasper/django-jsonfield/issues/52
75-
if not hasattr(obj, "pk") or obj.pk is not None:
75+
if hasattr(obj, "pk") and obj.pk is not None:
7676
if isinstance(value, six.string_types):
7777
try:
7878
return json.loads(value, **self.load_kwargs)

0 commit comments

Comments
 (0)