Fix: workflow password removal didn't handle lists from the DB (#12716)

This commit is contained in:
Trenton H
2026-05-05 12:52:34 -07:00
committed by GitHub
parent 76b2b6ad36
commit e2ad14f9ca
2 changed files with 4 additions and 9 deletions
+3 -3
View File
@@ -4164,7 +4164,7 @@ class TestWorkflows(
)
action = WorkflowAction.objects.create(
type=WorkflowAction.WorkflowActionType.PASSWORD_REMOVAL,
passwords="wrong, right\n extra ",
passwords=["wrong", "right", "extra"],
)
workflow = Workflow.objects.create(name="Password workflow")
workflow.triggers.add(trigger)
@@ -4218,7 +4218,7 @@ class TestWorkflows(
)
action = WorkflowAction.objects.create(
type=WorkflowAction.WorkflowActionType.PASSWORD_REMOVAL,
passwords=" \n , ",
passwords=[" ", " "],
)
workflow = Workflow.objects.create(name="Password workflow missing passwords")
workflow.triggers.add(trigger)
@@ -4276,7 +4276,7 @@ class TestWorkflows(
"""
action = WorkflowAction.objects.create(
type=WorkflowAction.WorkflowActionType.PASSWORD_REMOVAL,
passwords="first, second",
passwords=["first", "second"],
)
temp_dir = Path(tempfile.mkdtemp())
+1 -6
View File
@@ -1,5 +1,4 @@
import logging
import re
import uuid
from pathlib import Path
@@ -290,11 +289,7 @@ def execute_password_removal_action(
)
return
passwords = [
password.strip()
for password in re.split(r"[,\n]", passwords)
if password.strip()
]
passwords = [p.strip() for p in passwords if p.strip()]
if isinstance(document, ConsumableDocument):
# hook the consumption-finished signal to attempt password removal later