06/04 Optimize app
This commit is contained in:
+1
-5
@@ -35,11 +35,7 @@ class EncryptedText(types.TypeDecorator):
|
||||
def process_bind_param(self, value, dialect):
|
||||
if value is None:
|
||||
return None
|
||||
try:
|
||||
return _fernet().encrypt(value.encode()).decode()
|
||||
except Exception as exc:
|
||||
log.warning('[crypto] encrypt failed: %s', exc)
|
||||
return value # store plaintext rather than lose data
|
||||
return _fernet().encrypt(value.encode()).decode()
|
||||
|
||||
def process_result_value(self, value, dialect):
|
||||
if value is None:
|
||||
|
||||
Reference in New Issue
Block a user