mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-23 13:52:37 +00:00
Move the encrypt/decrypt decision out of db and into the view
This commit is contained in:
1 parent
da6dc2ad5b
commit
cdc07cf153
2 files changed
+7
-6
No files matched your search
@@ -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