Permalink
Browse files

Use get_db_prep_value instead of get_db_prep_save. Closes gh-42

  • Loading branch information...
1 parent 839a377 commit 3c8b3a24978cf757fb3a8cc8660eb4554f183e0f @omab omab committed Mar 29, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 social_auth/fields.py
View
5 social_auth/fields.py
@@ -34,10 +34,9 @@ def validate(self, value, model_instance):
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)

0 comments on commit 3c8b3a2

Please sign in to comment.