[Erp5-report] r38587 fx.algrain - /experimental/bt5/erp5_credential/SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 23 12:26:38 CEST 2010


Author: fx.algrain
Date: Thu Sep 23 12:26:36 2010
New Revision: 38587

URL: http://svn.erp5.org?rev=38587&view=rev
Log:
Copy list to preserve it.
Update only destination decision if needed. This is better when auto request validation.

Modified:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml?rev=38587&r1=38586&r2=38587&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml [utf8] Thu Sep 23 12:26:36 2010
@@ -56,11 +56,11 @@ the assignments of the person and send n
 if context.getCorporateName():\n
   related_portal_type.append(\'Organisation\')\n
 \n
-#Create related object\n
-context.CredentialRequest_setDefaultDestinationDecision(related_portal_type)\n
+#Create related object, pass a copy of the dict\n
+context.CredentialRequest_setDefaultDestinationDecision([x for x in related_portal_type])\n
 \n
-#Check consistency of the subscription\n
-context.Credential_checkConsistency(related_portal_type)\n
+#Check consistency of the subscription, pass a copy of the dict\n
+context.Credential_checkConsistency([x for x in related_portal_type])\n
 \n
 #Fill related object with  credential request\n
 for portal_type in related_portal_type:\n
@@ -119,7 +119,10 @@ context.CredentialRequest_sendAcceptedNo
                             <string>related_portal_type</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>append</string>
+                            <string>$append0</string>
                             <string>_getiter_</string>
+                            <string>x</string>
                             <string>portal_type</string>
                             <string>getattr</string>
                             <string>login</string>

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml?rev=38587&r1=38586&r2=38587&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml [utf8] Thu Sep 23 12:26:36 2010
@@ -54,8 +54,7 @@
 Return related person and related organisation"""\n
 \n
 destination_list = context.getDestinationDecisionValueList()\n
-\n
-\n
+update_destination_list = False\n
 for destination in destination_list:\n
   try:\n
     create_portal_type.remove(destination.getPortalType())\n
@@ -73,13 +72,16 @@ if "Organisation" in create_portal_type:
   if organisation_list:\n
     destination_list.append(organisation_list[0]) \n
     create_portal_type.remove("Organisation")\n
+    update_destination_list = True\n
 \n
 for portal_type in create_portal_type:\n
+  update_destination_list = True\n
   module = context.getDefaultModule(portal_type)  \n
   obj = module.newContent(portal_type=portal_type)\n
   destination_list.append(obj)\n
 \n
-context.setDestinationDecisionValueList(destination_list)\n
+if update_destination_list:\n
+  context.setDestinationDecisionValueList(destination_list)\n
 </string> </value>
         </item>
         <item>
@@ -120,6 +122,8 @@ context.setDestinationDecisionValueList(
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>destination_list</string>
+                            <string>False</string>
+                            <string>update_destination_list</string>
                             <string>_getiter_</string>
                             <string>destination</string>
                             <string>ValueError</string>
@@ -130,6 +134,7 @@ context.setDestinationDecisionValueList(
                             <string>$append0</string>
                             <string>x</string>
                             <string>_getitem_</string>
+                            <string>True</string>
                             <string>portal_type</string>
                             <string>obj</string>
                           </tuple>




More information about the Erp5-report mailing list