From 1fd7f457318f0424e7c92a9dd5ac87fb4cce39ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Tue, 23 Oct 2012 14:57:53 +0200
Subject: [PATCH] Protect against using damaged system.

---
 .../scripts/Person_requestComputer.xml                 | 10 +++++++++-
 master/bt5/vifib_slap/bt/revision                      |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestComputer.xml b/master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestComputer.xml
index ace65cacb..491046884 100644
--- a/master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestComputer.xml
+++ b/master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestComputer.xml
@@ -72,7 +72,15 @@ if (portal.portal_activities.countMessageWithTag(tag) > 0):\n
   raise NotImplementedError(tag)\n
 \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
   reference = "COMP-%s" % portal.portal_ids.generateNewId(\n
     id_group=\'slap_computer_reference\',\n
diff --git a/master/bt5/vifib_slap/bt/revision b/master/bt5/vifib_slap/bt/revision
index 147d4e7f1..203bd07e6 100644
--- a/master/bt5/vifib_slap/bt/revision
+++ b/master/bt5/vifib_slap/bt/revision
@@ -1 +1 @@
-845
\ No newline at end of file
+846
\ No newline at end of file
-- 
2.30.9