From 96b8dd6d56165fcc529345c22c84d85b804d7167 Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Sun, 3 Apr 2016 18:47:49 +0100 Subject: [PATCH] Added the passphrase to the consume hook and fixed the docs for it --- docs/consumption.rst | 2 ++ src/documents/signals/handlers.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/consumption.rst b/docs/consumption.rst index 2efab20ad..a84bea80b 100644 --- a/docs/consumption.rst +++ b/docs/consumption.rst @@ -64,6 +64,8 @@ What Can This Script Do? It's your script, so you're only limited by your imagination and the laws of physics. However, the following values are passed to the script in order: +* The value of ``PAPERLESS_PASSPHRASE``, which is used to encrypt your + documents * Document id * Generated file name * Source path diff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.py index f3d4d3a23..5c513b781 100644 --- a/src/documents/signals/handlers.py +++ b/src/documents/signals/handlers.py @@ -64,12 +64,13 @@ def run_external_script(sender, document, **kwargs): Popen(( settings.POST_CONSUME_SCRIPT, + settings.PASSPHRASE, + str(document.id), document.file_name, document.source_path, document.thumbnail_path, document.download_url, document.thumbnail_url, - str(document.id), str(document.correspondent), str(",".join(document.tags.all().values_list("slug", flat=True))) )).wait()