8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

Merge branch 'fix_payment' into 'master'

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

See merge request federez/re2o!81
This commit is contained in:
chirac 2018-02-23 11:31:42 +01:00
commit 2aec9782ed

View file

@ -27,14 +27,11 @@ def encrypt(key, s):
def decrypt(key, s):
obj = AES.new(key)
ss = obj.decrypt(s)
print(ss)
return ss.split(bytes(EOD, 'utf-8'))[0]
class AESEncryptedField(models.CharField):
def save_form_data(self, instance, data):
if value is None:
return value
setattr(instance, self.name,
binascii.b2a_base64(encrypt(settings.AES_KEY, data)))