Explorar el Código

If else add regexmatch (#8059)

Co-authored-by: 罗威 <luowei@cvte.com>
crazywoola hace 7 meses
padre
commit
44f963f281
Se han modificado 1 ficheros con 1 adiciones y 6 borrados
  1. 1 6
      api/core/workflow/nodes/if_else/if_else_node.py

+ 1 - 6
api/core/workflow/nodes/if_else/if_else_node.py

@@ -296,12 +296,7 @@ class IfElseNode(BaseNode):
         """
         if actual_value is None:
             return False
-
-        pattern = re.compile(expected_value)
-        regex_result = pattern.findall(actual_value)
-        if len(regex_result) > 0:
-            return True
-        return False
+        return re.search(expected_value, actual_value) is not None
 
     def _assert_not_empty(self, actual_value: Optional[str]) -> bool:
         """