[Python-modules-commits] [python-social-auth] 03/06: django 1.8+ compat to ensure to_python is always called when accessing result from db..

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


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

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

commit f974acf87152dc530f8658450c03d26c7d7568cc
Author: sbussetti <steve.bussetti at gmail.com>
Date:   Wed Apr 13 19:47:07 2016 -0400

    django 1.8+ compat to ensure to_python is always called when accessing result from db..
---
 social/apps/django_app/default/fields.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/social/apps/django_app/default/fields.py b/social/apps/django_app/default/fields.py
index 4a865ee..46b134b 100644
--- a/social/apps/django_app/default/fields.py
+++ b/social/apps/django_app/default/fields.py
@@ -20,6 +20,9 @@ class JSONField(models.TextField):
         kwargs.setdefault('default', '{}')
         super(JSONField, self).__init__(*args, **kwargs)
 
+    def from_db_value(self, value, expression, connection, context):
+        return self.to_python(value)
+
     def to_python(self, value):
         """
         Convert the input JSON value into python structures, raises

-- 
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