Commit 62191dac authored by Aurel's avatar Aurel

make sure we only take the first three letters of codification, improve error message

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24561 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e6b02f2e
......@@ -73,11 +73,11 @@ if not isinstance(site, str):\n
\n
def getCountry(site):\n
site = context.portal_categories.restrictedTraverse(site)\n
orga_id = "site_%3s" %(site.getCodification())\n
orga_id = "site_%3s" %(site.getCodification()[:3])\n
organisation = context.organisation_module[orga_id]\n
country = organisation.getDefaultRegionTitle()\n
if country is None:\n
raise ValueError, "No Region defined on site agency %s" %(site.getPath(),)\n
raise ValueError, "No Region found for site %s / %s defined by organisation %s" %(site.getPath(), site.getCodification(), organisation.getPath())\n
return country\n
\n
\n
......
464
\ No newline at end of file
465
\ 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