Django GPG: Setting options changes
Remove the SIGNATURES_GPG_HOME settings. The GPG keys are no longer stored in disk but in the database itself making this setting obsolete. This changed happened several versions ago and this removal doesn't affect any code path. Add two new settings to the app: SIGNATURES_GPG_BACKEND and SIGNATURES_GPG_BACKEND_ARGUMENTS. These settings allow changing the GPG backend that the app will use. Remove the settings SIGNATURES_GPG_PATH. The path to the GPG binary is now passed via the SIGNATURES_GPG_BACKEND_ARGUMENTS. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -10,7 +10,8 @@ from mayan.apps.common.utils import mkdtemp
|
||||
|
||||
|
||||
class GPGBackend(object):
|
||||
def __init__(self, **kwargs):
|
||||
def __init__(self, gpg_path, **kwargs):
|
||||
self.gpg_path = gpg_path
|
||||
self.kwargs = kwargs
|
||||
|
||||
|
||||
@@ -76,7 +77,7 @@ class PythonGNUPGBackend(GPGBackend):
|
||||
os.chmod(temporary_directory, 0x1C0)
|
||||
|
||||
gpg = gnupg.GPG(
|
||||
gnupghome=temporary_directory, gpgbinary=self.kwargs['binary_path']
|
||||
gnupghome=temporary_directory, gpgbinary=self.gpg_path
|
||||
)
|
||||
|
||||
result = function(gpg=gpg, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user