mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Move the encrypt/decrypt decision out of db and into the view
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user