From fbca63c1a15fb8fedb5ea7856382b759a42ec4eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Wed, 27 Aug 2008 12:22:33 +0000
Subject: [PATCH] simplify code that creates active process

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23193 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFActivity/ActiveProcess.py | 1 +
 product/CMFActivity/ActivityTool.py  | 5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/product/CMFActivity/ActiveProcess.py b/product/CMFActivity/ActiveProcess.py
index d5b141e6d8..48660b3864 100644
--- a/product/CMFActivity/ActiveProcess.py
+++ b/product/CMFActivity/ActiveProcess.py
@@ -53,6 +53,7 @@ def addActiveProcess(self, id, title='', REQUEST=None, activate_kw=None, **kw):
     if kw: o._edit(force_update=1, **kw)
     if REQUEST is not None:
         REQUEST['RESPONSE'].redirect( 'manage_main' )
+    return o
 
 class ActiveProcess(Base):
     """
diff --git a/product/CMFActivity/ActivityTool.py b/product/CMFActivity/ActivityTool.py
index b1975dbb2b..20d75cdfdb 100644
--- a/product/CMFActivity/ActivityTool.py
+++ b/product/CMFActivity/ActivityTool.py
@@ -1213,10 +1213,7 @@ class ActivityTool (Folder, UniqueObject):
     def newActiveProcess(self, **kw):
       from ActiveProcess import addActiveProcess
       new_id = str(self.generateNewId())
-      addActiveProcess(self, new_id)
-      active_process = self._getOb(new_id)
-      active_process.edit(**kw)
-      return active_process
+      return addActiveProcess(self, new_id, **kw)
 
     def reindexObject(self):
       self.immediateReindexObject()
-- 
2.30.9