[Python-modules-commits] [python-social-auth] 26/131: Corrected default value of JSONField

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:16:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.20
in repository python-social-auth.

commit b3ef827c7c8dc37484654e1923afd4c2eaec18f6
Author: Clinton Blackburn <clinton.blackburn at gmail.com>
Date:   Sat Apr 23 00:09:53 2016 -0400

    Corrected default value of JSONField
    
    The default should be an empty dict, not a string value.
    
    Fixes #898
---
 social/apps/django_app/default/fields.py             |  2 +-
 .../default/migrations/0004_auto_20160423_0400.py    | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/social/apps/django_app/default/fields.py b/social/apps/django_app/default/fields.py
index 46b134b..8593386 100644
--- a/social/apps/django_app/default/fields.py
+++ b/social/apps/django_app/default/fields.py
@@ -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):
diff --git a/social/apps/django_app/default/migrations/0004_auto_20160423_0400.py b/social/apps/django_app/default/migrations/0004_auto_20160423_0400.py
new file mode 100644
index 0000000..668bf0e
--- /dev/null
+++ b/social/apps/django_app/default/migrations/0004_auto_20160423_0400.py
@@ -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={}),
+        ),
+    ]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git



More information about the Python-modules-commits mailing list