Fix: dont try to parse empty params

This commit is contained in:
shamoon 2025-01-14 23:07:26 -08:00
parent d61b2bbfc6
commit d27a74c84a
No known key found for this signature in database

View File

@ -992,25 +992,26 @@ def run_workflows(
try: try:
data = {} data = {}
if action.webhook.use_params: if action.webhook.use_params:
try: if action.webhook.params:
for key, value in action.webhook.params.items(): try:
data[key] = parse_w_workflow_placeholders( for key, value in action.webhook.params.items():
value, data[key] = parse_w_workflow_placeholders(
correspondent, value,
document_type, correspondent,
owner_username, document_type,
added, owner_username,
filename, added,
current_filename, filename,
created, current_filename,
title, created,
doc_url, 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: else:
data = parse_w_workflow_placeholders( data = parse_w_workflow_placeholders(
action.webhook.body, action.webhook.body,