Commit decf57f0 authored by Hugo LEVY-FALK's avatar Hugo LEVY-FALK

ReFix le AESField

parent ba25477e
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment