Commit 1fd7f457 authored by Łukasz Nowak's avatar Łukasz Nowak

Protect against using damaged system.

parent 6bc6390a
...@@ -72,7 +72,15 @@ if (portal.portal_activities.countMessageWithTag(tag) > 0):\n ...@@ -72,7 +72,15 @@ if (portal.portal_activities.countMessageWithTag(tag) > 0):\n
raise NotImplementedError(tag)\n raise NotImplementedError(tag)\n
\n \n
computer_portal_type = "Computer"\n computer_portal_type = "Computer"\n
computer = portal.portal_catalog.getResultValue(portal_type=computer_portal_type, title=computer_title)\n computer_list = portal.portal_catalog.portal_catalog(portal_type=computer_portal_type, title=computer_title, limit=2)\n
\n
if len(computer_list) == 2:\n
raise NotImplementedError\n
elif len(computer_list) == 1:\n
computer = computer_list[0]\n
else:\n
computer = None\n
\n
if computer is None:\n if computer is None:\n
reference = "COMP-%s" % portal.portal_ids.generateNewId(\n reference = "COMP-%s" % portal.portal_ids.generateNewId(\n
id_group=\'slap_computer_reference\',\n id_group=\'slap_computer_reference\',\n
......
845 846
\ 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