[Erp5-report] r34661 jerome - /erp5/trunk/bt5/erp5_base/WorkflowTemplateItem/portal_workflo...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 19 17:01:21 CEST 2010
Author: jerome
Date: Mon Apr 19 17:01:19 2010
New Revision: 34661
URL: http://svn.erp5.org?rev=34661&view=rev
Log:
remove workflow script that was checking that a person have only one active career. This is not always true. Check constraints instead.
Removed:
erp5/trunk/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/career_workflow/scripts/Career_checkUniqueActiveCareer.xml
Removed: erp5/trunk/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/career_workflow/scripts/Career_checkUniqueActiveCareer.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/career_workflow/scripts/Career_checkUniqueActiveCareer.xml?rev=34660&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/career_workflow/scripts/Career_checkUniqueActiveCareer.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/career_workflow/scripts/Career_checkUniqueActiveCareer.xml (removed)
@@ -1,151 +1,0 @@
-<?xml version="1.0"?>
-<ZopeData>
- <record id="1" aka="AAAAAAAAAAE=">
- <pickle>
- <tuple>
- <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
- <tuple/>
- </tuple>
- </pickle>
- <pickle>
- <dictionary>
- <item>
- <key> <string>Script_magic</string> </key>
- <value> <int>3</int> </value>
- </item>
- <item>
- <key> <string>_bind_names</string> </key>
- <value>
- <object>
- <klass>
- <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
- </klass>
- <tuple/>
- <state>
- <dictionary>
- <item>
- <key> <string>_asgns</string> </key>
- <value>
- <dictionary>
- <item>
- <key> <string>name_container</string> </key>
- <value> <string>container</string> </value>
- </item>
- <item>
- <key> <string>name_context</string> </key>
- <value> <string>context</string> </value>
- </item>
- <item>
- <key> <string>name_m_self</string> </key>
- <value> <string>script</string> </value>
- </item>
- <item>
- <key> <string>name_subpath</string> </key>
- <value> <string>traverse_subpath</string> </value>
- </item>
- </dictionary>
- </value>
- </item>
- </dictionary>
- </state>
- </object>
- </value>
- </item>
- <item>
- <key> <string>_body</string> </key>
- <value> <string encoding="cdata"><![CDATA[
-
-from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
-\n
-# Get the career object and its parent\n
-career_object = state_change[\'object\']\n
-person_object = career_object.getParentValue()\n
-\n
-active_careers = []\n
-\n
-# Count the number of opened career\n
-for career in person_object.contentValues(filter={\'portal_type\': \'Career\'}):\n
- if career.getValidationState() == \'open\':\n
- active_careers.append(career.getTitleOrId())\n
-\n
-# There is at least one open career, so we can\'t open a new one until the current one is inactive (closed or cancelled)\n
-# XXX is this check really needed ?\n
-if len(active_careers) > 0:\n
- raise ValidationFailed, "Error : current active career (\'" + "\', \'".join(active_careers) + "\') must be inactive"\n
-
-
-]]></string> </value>
- </item>
- <item>
- <key> <string>_code</string> </key>
- <value>
- <none/>
- </value>
- </item>
- <item>
- <key> <string>_params</string> </key>
- <value> <string>state_change</string> </value>
- </item>
- <item>
- <key> <string>errors</string> </key>
- <value>
- <tuple/>
- </value>
- </item>
- <item>
- <key> <string>func_code</string> </key>
- <value>
- <object>
- <klass>
- <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
- </klass>
- <tuple/>
- <state>
- <dictionary>
- <item>
- <key> <string>co_argcount</string> </key>
- <value> <int>1</int> </value>
- </item>
- <item>
- <key> <string>co_varnames</string> </key>
- <value>
- <tuple>
- <string>state_change</string>
- <string>Products.DCWorkflow.DCWorkflow</string>
- <string>ValidationFailed</string>
- <string>_getitem_</string>
- <string>career_object</string>
- <string>_getattr_</string>
- <string>person_object</string>
- <string>active_careers</string>
- <string>_getiter_</string>
- <string>career</string>
- <string>len</string>
- </tuple>
- </value>
- </item>
- </dictionary>
- </state>
- </object>
- </value>
- </item>
- <item>
- <key> <string>func_defaults</string> </key>
- <value>
- <none/>
- </value>
- </item>
- <item>
- <key> <string>id</string> </key>
- <value> <string>Career_checkUniqueActiveCareer</string> </value>
- </item>
- <item>
- <key> <string>warnings</string> </key>
- <value>
- <tuple/>
- </value>
- </item>
- </dictionary>
- </pickle>
- </record>
-</ZopeData>
More information about the Erp5-report
mailing list