8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-05-20 17:42:26 +00:00

Fix du AESEncryptedField

This commit is contained in:
Hugo LEVY-FALK 2018-06-17 14:57:11 +02:00
parent 9cae582201
commit f02e6c6e1f

View file

@ -79,6 +79,12 @@ class AESEncryptedField(models.CharField):
return decrypt(settings.AES_KEY,
binascii.a2b_base64(value)).decode('utf-8')
def from_db_value(self, value, *args, **kwargs):
if value is None:
return value
return decrypt(settings.AES_KEY,
binascii.a2b_base64(value)).decode('utf-8')
def get_prep_value(self, value):
if value is None:
return value