Skip to content

Commit

Permalink
Merge pull request #908 from clintonb/json-field-fix
Browse files Browse the repository at this point in the history
Corrected default value of JSONField
  • Loading branch information
omab committed Apr 26, 2016
2 parents 7edf3c7 + b3ef827 commit 4c47775
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion social/apps/django_app/default/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class JSONField(models.TextField):
"""

def __init__(self, *args, **kwargs):
kwargs.setdefault('default', '{}')
kwargs.setdefault('default', {})
super(JSONField, self).__init__(*args, **kwargs)

def from_db_value(self, value, expression, connection, context):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
import social.apps.django_app.default.fields


class Migration(migrations.Migration):

dependencies = [
('default', '0003_alter_email_max_length'),
]

operations = [
migrations.AlterField(
model_name='usersocialauth',
name='extra_data',
field=social.apps.django_app.default.fields.JSONField(default={}),
),
]

0 comments on commit 4c47775

Please sign in to comment.