mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 20:46:49 +01:00
src/paperless/db.py: If encryption is disabled, just directly read the file contents
This commit is contained in:
parent
8783c2af88
commit
3b6a3219f5
1 changed files with 4 additions and 0 deletions
|
|
@ -12,11 +12,15 @@ class GnuPG(object):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def decrypted(cls, file_handle):
|
def decrypted(cls, file_handle):
|
||||||
|
if(not settings.ENABLE_ENCRYPTION):
|
||||||
|
return file_handle.read()
|
||||||
return cls.gpg.decrypt_file(
|
return cls.gpg.decrypt_file(
|
||||||
file_handle, passphrase=settings.PASSPHRASE).data
|
file_handle, passphrase=settings.PASSPHRASE).data
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def encrypted(cls, file_handle):
|
def encrypted(cls, file_handle):
|
||||||
|
if(not settings.ENABLE_ENCRYPTION):
|
||||||
|
return file_handle.read()
|
||||||
return cls.gpg.encrypt_file(
|
return cls.gpg.encrypt_file(
|
||||||
file_handle,
|
file_handle,
|
||||||
recipients=None,
|
recipients=None,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue