Commit 49e299c2 authored by Fabien Morin's avatar Fabien Morin

2008-11-01 fabien

* fix some problem in the send of credentials. Now it works, even with yahoo ! (not considered as spam)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24446 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a038da9f
...@@ -61,24 +61,23 @@ organisation. It uses portal_notifications and the getObject API of ERP5Catalog. ...@@ -61,24 +61,23 @@ organisation. It uses portal_notifications and the getObject API of ERP5Catalog.
"""\n """\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n \n
object = state_change[\'object\']\n
\n \n
translateString = object.Base_translateString\n translateString = context.Base_translateString\n
portal_catalog = object.portal_catalog\n portal_catalog = context.portal_catalog\n
ninea = object.getNinea()\n vat_code = context.getVatCode()\n
\n \n
# get the new organisation :\n # get the new organisation :\n
result = portal_catalog(portal_type=\'Organisation\',\n result = portal_catalog(portal_type=\'Organisation\',\n
vat_code=ninea)\n vat_code=vat_code)\n
\n \n
if len(result) > 1:\n if len(result) > 1:\n
msg = "Error : There is more than one company with the NINEA code ${code}"\n msg = "Error : There is more than one company with the NINEA code ${code}"\n
msg = translateString(msg, mapping=dict(code=ninea))\n msg = translateString(msg, mapping=dict(code=vat_code))\n
raise ValidationFailed, msg \n raise ValidationFailed, msg \n
\n \n
if len(result) == 0 and result[0].getObject().getReference():\n if len(result) == 0:\n
msg = "No organisation with the NINEA code ${code}"\n msg = "No organisation with the NINEA code ${code}"\n
msg = translateString(msg, mapping=dict(code=ninea))\n msg = translateString(msg, mapping=dict(code=vat_code))\n
raise ValidationFailed, msg \n raise ValidationFailed, msg \n
\n \n
organisation = result[0]\n organisation = result[0]\n
...@@ -99,8 +98,9 @@ msg = translateString(msg,\n ...@@ -99,8 +98,9 @@ msg = translateString(msg,\n
)\n )\n
\n \n
# We can now notify the owner through the notification tool\n # We can now notify the owner through the notification tool\n
object.portal_notifications.sendMessage(recipient=organisation.getReference(), \n context.portal_notifications.sendMessage(recipient=organisation.getReference(), \n
subject=subject, message=msg, portal_type_list=(\'Person\', \'Organisation\'))\n subject=subject, message=msg, portal_type_list=(\'Person\', \'Organisation\'),\n
store_as_event=True)\n
]]></string> </value> ]]></string> </value>
...@@ -113,7 +113,7 @@ object.portal_notifications.sendMessage(recipient=organisation.getReference(), \ ...@@ -113,7 +113,7 @@ object.portal_notifications.sendMessage(recipient=organisation.getReference(), \
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>state_change</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
...@@ -142,27 +142,27 @@ object.portal_notifications.sendMessage(recipient=organisation.getReference(), \ ...@@ -142,27 +142,27 @@ object.portal_notifications.sendMessage(recipient=organisation.getReference(), \
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>state_change</string>
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>_getitem_</string>
<string>object</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
<string>translateString</string> <string>translateString</string>
<string>portal_catalog</string> <string>portal_catalog</string>
<string>ninea</string> <string>vat_code</string>
<string>result</string> <string>result</string>
<string>len</string> <string>len</string>
<string>msg</string> <string>msg</string>
<string>dict</string> <string>dict</string>
<string>_getitem_</string>
<string>organisation</string> <string>organisation</string>
<string>subject</string> <string>subject</string>
<string>True</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -179,7 +179,7 @@ object.portal_notifications.sendMessage(recipient=organisation.getReference(), \ ...@@ -179,7 +179,7 @@ object.portal_notifications.sendMessage(recipient=organisation.getReference(), \
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>sendCrendentialsByEMail</string> </value> <value> <string>Organisation_sendCrendentialsByEMail</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -25,16 +25,20 @@ ...@@ -25,16 +25,20 @@
<key> <string>activate_script_name</string> </key> <key> <string>activate_script_name</string> </key>
<value> <value>
<list> <list>
<string>sendCrendentialsByEMail</string> <string>SubscriptionForm_createAccount</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>after_script_name</string> </key> <key> <string>after_script_name</string> </key>
<value> <value>
<list> <tuple/>
<string>SubscriptionForm_createAccount</string> </value>
</list> </item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -73,7 +73,8 @@ if not len(result):\n ...@@ -73,7 +73,8 @@ if not len(result):\n
address_region=changed_object.getAddressRegion(),\n address_region=changed_object.getAddressRegion(),\n
corporate_registration_code=changed_object.getRccm(),\n corporate_registration_code=changed_object.getRccm(),\n
vat_code=changed_object.getNinea(),\n vat_code=changed_object.getNinea(),\n
default_email_text=changed_object.getEmail()\n default_email_text=changed_object.getEmail(),\n
activity_kw={\'tag\':\'organisation_creation_%s\' % changed_object.getRelativeUrl()}\n
)\n )\n
else:\n else:\n
organisation = result[0].getObject()\n organisation = result[0].getObject()\n
...@@ -83,6 +84,9 @@ else:\n ...@@ -83,6 +84,9 @@ else:\n
login = context.generateNewLogin(text=changed_object.getCompanyName())\n login = context.generateNewLogin(text=changed_object.getCompanyName())\n
password = changed_object.Person_generatePassword()\n password = changed_object.Person_generatePassword()\n
context.EGov_setLoginAndPasswordAsManager(organisation, login, password)\n context.EGov_setLoginAndPasswordAsManager(organisation, login, password)\n
organisation.immediateReindexObject()\n
\n
organisation.Organisation_sendCrendentialsByEMail()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
2008-11-01 fabien
* fix some problem in the send of credentials. Now it works, even with yahoo ! (not considered as spam)
2008-10-21 fabien 2008-10-21 fabien
* fix some mistakes in sendCrendentialsByEMail workflow script and remove sender because it's not required * fix some mistakes in sendCrendentialsByEMail workflow script and remove sender because it's not required
* update testEgovMixin to add some other generic methods * update testEgovMixin to add some other generic methods
......
428 430
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment