Skip to content

Commit

Permalink
Use get_db_prep_value instead of get_db_prep_save. Closes gh-42
Browse files Browse the repository at this point in the history
  • Loading branch information
omab committed Mar 29, 2011
1 parent 839a377 commit 3c8b3a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions social_auth/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.