Fixed some bugs in the EncryptedTextField class.
- Legacy-Id: 6246
This commit is contained in:
parent
0016c69b61
commit
86cf15cd9f
|
@ -3,7 +3,7 @@ from django.db import models
|
|||
from django.utils.encoding import smart_str
|
||||
|
||||
from ietf.utils.pipe import pipe
|
||||
|
||||
from ietf.utils.log import log
|
||||
|
||||
class EncryptedException(Exception):
|
||||
pass
|
||||
|
@ -19,10 +19,10 @@ class EncryptedTextField(models.TextField):
|
|||
except ValueError as e:
|
||||
raise ValueError("Trying to read the NomCom public key: " + str(e))
|
||||
|
||||
code, out, error = pipe("%s smime -encrypt -in /dev/stdin %s" % (settings.OPENSSL_COMMAND,
|
||||
cert_file), comments)
|
||||
command = "%s smime -encrypt -in /dev/stdin %s" % (settings.OPENSSL_COMMAND, cert_file)
|
||||
code, out, error = pipe(command, comments)
|
||||
if code != 0:
|
||||
log("openssl error: %s:\n Error %s: %s" %(command, code, error))
|
||||
log("openssl error: %s:\n Error %s: %s" %(command, code, error))
|
||||
if not error:
|
||||
instance.comments = out
|
||||
return out
|
||||
|
|
Loading…
Reference in a new issue