Commit 044cb341 authored by Vincent Pelletier's avatar Vincent Pelletier

Explicitly fetch from portal object.

parent 84ba70f5
...@@ -50,11 +50,10 @@ ...@@ -50,11 +50,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if isinstance(site, str):\n <value> <string>portal = context.getPortalObject()\n
site = context.portal_categories.site.restrictedTraverse(site)\n if isinstance(site, str):\n
orga_id = "site_%3s" %(site.getCodification())\n site = portal.portal_categories.site.restrictedTraverse(site)\n
organisation = context.organisation_module[orga_id]\n organisation = portal.organisation_module[\'site_%3s\' % (site.getCodification(), )]\n
\n
account_list = [x for x in organisation.objectValues(portal_type=\'Bank Account\') if x.getValidationState() == \'valid\']\n account_list = [x for x in organisation.objectValues(portal_type=\'Bank Account\') if x.getValidationState() == \'valid\']\n
if len(account_list) != 1:\n if len(account_list) != 1:\n
raise ValueError(\'Must not get %d account for the organisation %s\' % (len(account_list), organisation.getTitleOrId()))\n raise ValueError(\'Must not get %d account for the organisation %s\' % (len(account_list), organisation.getTitleOrId()))\n
......
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