mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 12:37:08 +01:00
Move the encrypt/decrypt decision out of db and into the view
This commit is contained in:
parent
da6dc2ad5b
commit
cdc07cf153
2 changed files with 7 additions and 6 deletions
|
|
@ -12,15 +12,11 @@ class GnuPG(object):
|
|||
|
||||
@classmethod
|
||||
def decrypted(cls, file_handle):
|
||||
if(not settings.ENABLE_ENCRYPTION):
|
||||
return file_handle.read()
|
||||
return cls.gpg.decrypt_file(
|
||||
file_handle, passphrase=settings.PASSPHRASE).data
|
||||
|
||||
@classmethod
|
||||
def encrypted(cls, file_handle):
|
||||
if(not settings.ENABLE_ENCRYPTION):
|
||||
return file_handle.read()
|
||||
return cls.gpg.encrypt_file(
|
||||
file_handle,
|
||||
recipients=None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue