Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fix: dont try to parse empty params (#8742)

shamoon1e3f2a143837
diff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.py
index 09ea7bf01..efba1e41c 100644
--- a/src/documents/signals/handlers.py
+++ b/src/documents/signals/handlers.py
@@ -992,25 +992,26 @@ def run_workflows(
try:
data = {}
if action.webhook.use_params:
- try:
- for key, value in action.webhook.params.items():
- data[key] = parse_w_workflow_placeholders(
- value,
- correspondent,
- document_type,
- owner_username,
- added,
- filename,
- current_filename,
- created,
- title,
- doc_url,
+ if action.webhook.params:
+ try:
+ for key, value in action.webhook.params.items():
+ data[key] = parse_w_workflow_placeholders(
+ value,
+ correspondent,
+ document_type,
+ owner_username,
+ added,
+ filename,
+ current_filename,
+ created,
+ title,
+ doc_url,
+ )
+ except Exception as e:
+ logger.error(
+ f"Error occurred parsing webhook params: {e}",
+ extra={"group": logging_group},
)
- except Exception as e:
- logger.error(
- f"Error occurred parsing webhook params: {e}",
- extra={"group": logging_group},
- )
else:
data = parse_w_workflow_placeholders(
action.webhook.body,