From: Matías Aguirre Date: Tue, 29 Mar 2011 15:45:20 +0000 (-0300) Subject: Use get_db_prep_value instead of get_db_prep_save. Closes gh-42 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3c8b3a24978cf757fb3a8cc8660eb4554f183e0f;p=django-social-auth.git Use get_db_prep_value instead of get_db_prep_save. Closes gh-42 --- diff --git a/social_auth/fields.py b/social_auth/fields.py index ec52d9a..4664155 100644 --- a/social_auth/fields.py +++ b/social_auth/fields.py @@ -34,10 +34,9 @@ class JSONField(models.TextField): except Exception, e: raise ValidationError(str(e)) - def get_db_prep_save(self, value): + def get_db_prep_value(self, value, connection, prepared=False): """Convert value to JSON string before save""" try: - value = simplejson.dumps(value) + return simplejson.dumps(value) except Exception, e: raise ValidationError(str(e)) - return super(JSONField, self).get_db_prep_save(value)