Skip to content

Commit

Permalink
Fix and rework from_db_value & to_python for EncryptedJSONField
Browse files Browse the repository at this point in the history
  • Loading branch information
cslzchen committed Sep 15, 2022
1 parent 95c9c83 commit dd377cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osf/utils/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def get_prep_value(self, value, **kwargs):
return super(EncryptedJSONField, self).get_prep_value(value, **kwargs)

def to_python(self, value):
value = rapply(value, decrypt_string, prefix=self.prefix)
return super(EncryptedJSONField, self).from_db_value(value, None, None)
return rapply(value, decrypt_string, prefix=self.prefix)

def from_db_value(self, value, expression, connection):
value = super(EncryptedJSONField, self).from_db_value(value, expression, connection)
return self.to_python(value)

0 comments on commit dd377cc

Please sign in to comment.