Commit 2aec9782 authored by chirac's avatar chirac
Browse files

Merge branch 'fix_payment' into 'master'

Répare le champ AESField (test de value inutile)

See merge request federez/re2o!81
parents 6dae1af9 d3a4d712
...@@ -27,14 +27,11 @@ def encrypt(key, s): ...@@ -27,14 +27,11 @@ def encrypt(key, s):
def decrypt(key, s): def decrypt(key, s):
obj = obj =
ss = obj.decrypt(s) ss = obj.decrypt(s)
return ss.split(bytes(EOD, 'utf-8'))[0] return ss.split(bytes(EOD, 'utf-8'))[0]
class AESEncryptedField(models.CharField): class AESEncryptedField(models.CharField):
def save_form_data(self, instance, data): def save_form_data(self, instance, data):
if value is None:
return value
setattr(instance,, setattr(instance,,
binascii.b2a_base64(encrypt(settings.AES_KEY, data))) binascii.b2a_base64(encrypt(settings.AES_KEY, data)))
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