Closed EvaSDK closed 7 years ago
To run python-social-auth >= 0.2.15
on Django < 1.8
, can use this mokey patch (past it in the end of settings.py
):
def monkey_patch_socialauth_JSONField():
from django.db import models
from social.apps.django_app.default.fields import JSONField
from social.apps.django_app.default.models import AbstractUserSocialAuth
class PatchedJSONField(JSONField):
__metaclass__ = models.SubfieldBase
AbstractUserSocialAuth.add_to_class('extra_data', PatchedJSONField())
monkey_patch_socialauth_JSONField():
Which makes it impossible to access extra_data since it is not unserialized.
I had to apply this workaround https://github.com/Linkuist/linkuist/commit/12716355286382c791f4b7f820b9ac3f9a008d62 in an old django 1.6 based project to get through strange
AttributeError: 'unicode' object has no attribute 'get'
orTypeError: string indices must be integers
errors.