Commit 7fcb1e34 authored by Romain Courteaud's avatar Romain Courteaud

Prevent the alarm to fail if the category does not exist

parent ffac75aa
......@@ -52,13 +52,15 @@
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
\n
portal.portal_catalog.searchAndActivate(\n
portal_type=\'Computer\',\n
default_allocation_scope_uid=portal.restrictedTraverse("portal_categories/allocation_scope/open/public").getUid(),\n
validation_state="validated",\n
method_id=\'Computer_checkAndUpdateCapacityScope\',\n
activate_kw={\'tag\': tag}\n
)\n
category = portal.restrictedTraverse("portal_categories/allocation_scope/open/public", None)\n
if category is not None:\n
portal.portal_catalog.searchAndActivate(\n
portal_type=\'Computer\',\n
default_allocation_scope_uid=category.getUid(),\n
validation_state="validated",\n
method_id=\'Computer_checkAndUpdateCapacityScope\',\n
activate_kw={\'tag\': tag}\n
)\n
context.activate(after_tag=tag).getId()\n
</string> </value>
</item>
......
143
\ No newline at end of file
144
\ 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