Commit c4064567 authored by Jérome Perrin's avatar Jérome Perrin Committed by Romain Courteaud

Base_getSectionUidListForSectionCategory : returns [-1] if no organisations...

Base_getSectionUidListForSectionCategory : returns [-1] if no organisations are member of this section_category.

This way we can directly pass the returned value as section_uid= to
getInventory without worrying about the problem that if this section category
has no member, then section_uid parameter is ignored.
parent 07d036e7
...@@ -55,14 +55,15 @@ ...@@ -55,14 +55,15 @@
This will only return organisations member of this section category.\n This will only return organisations member of this section category.\n
If \'strict_membership\' is true, then only organisations strictly member\n If \'strict_membership\' is true, then only organisations strictly member\n
of the category will be returned.\n of the category will be returned.\n
If no organisations are member of this section category, then [-1] is returned.\n
"""\n """\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
section = portal.portal_categories.restrictedTraverse(section_category)\n section = portal.portal_categories.restrictedTraverse(section_category)\n
return [x.getUid() for x in\n return [x.uid for x in\n
section.getGroupRelatedValueList(portal_type=\'Organisation\',\n section.getGroupRelatedValueList(portal_type=\'Organisation\',\n
strict_membership=strict_membership,\n strict_membership=strict_membership,\n
checked_permission=\'View\')]\n checked_permission=\'View\')] or [-1]\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
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