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