From e09437836e9e59b7df1853ec2bce97267aa3cea8 Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Wed, 1 Oct 2008 09:40:39 +0000
Subject: [PATCH] 2008-10-01 yusei * Fixed a bug in Bug_sendNotification in
 bug_workflow. Workflow history's action may be None.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23927 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../bug_workflow/scripts/Bug_sendNotification.xml              | 3 ++-
 bt5/erp5_forge/bt/change_log                                   | 3 +++
 bt5/erp5_forge/bt/revision                                     | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/Bug_sendNotification.xml b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/Bug_sendNotification.xml
index 84eba912d8..ee458d5774 100644
--- a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/Bug_sendNotification.xml
+++ b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/bug_workflow/scripts/Bug_sendNotification.xml
@@ -59,7 +59,7 @@ bug = state_change["object"]\n
 history = bug.portal_workflow.getInfoFor(bug, \'history\',\n
                                          wf_id=\'bug_workflow\')\n
 for history_item in history[::-1]:\n
-  if history_item[\'action\'].endswith(\'action\'):\n
+  if same_type(history_item[\'action\'], \'\') and history_item[\'action\'].endswith(\'action\'):\n
     send_event = history_item[\'send_event\']\n
     is_re_assign_action = bool(history_item[\'action\'] == \'re_assign_action\')\n
     break\n
@@ -138,6 +138,7 @@ else:\n
                             <string>history</string>
                             <string>_getiter_</string>
                             <string>history_item</string>
+                            <string>same_type</string>
                             <string>send_event</string>
                             <string>bool</string>
                             <string>is_re_assign_action</string>
diff --git a/bt5/erp5_forge/bt/change_log b/bt5/erp5_forge/bt/change_log
index f99d5dd057..d01327da8b 100644
--- a/bt5/erp5_forge/bt/change_log
+++ b/bt5/erp5_forge/bt/change_log
@@ -1,3 +1,6 @@
+2008-10-01 yusei
+* Fixed a bug in Bug_sendNotification in bug_workflow. Workflow history's action may be None.
+
 2008-09-04 yusei
 * Update English messages.
 
diff --git a/bt5/erp5_forge/bt/revision b/bt5/erp5_forge/bt/revision
index eb8f2fa1ae..96baa13486 100644
--- a/bt5/erp5_forge/bt/revision
+++ b/bt5/erp5_forge/bt/revision
@@ -1 +1 @@
-379
\ No newline at end of file
+381
\ No newline at end of file
-- 
2.30.9