From 9973a674be49d6c4464f1ef6e689dcdbeddc5987 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Tue, 23 Feb 2010 13:31:44 +0000
Subject: [PATCH] Attach to context only if not already attached.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33032 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_ingestion/Base_contribute.xml         | 6 ++++--
 bt5/erp5_ingestion/bt/revision                              | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml b/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml
index c05c1a4885..cb8aa193d3 100644
--- a/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml
+++ b/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Base_contribute.xml
@@ -116,8 +116,10 @@ else:\n
   if attach_document_to_context:\n
     # attach document to current context using follow_up\n
     follow_up_list = document.getFollowUpValueList()\n
-    follow_up_list.append(context)\n
-    document.setFollowUpValueList([x.getRelativeUrl() for x in follow_up_list])\n
+    if context not in follow_up_list:\n
+      # attach to context only if not already attached\n
+      follow_up_list.append(context)\n
+      document.setFollowUpValueList([x.getRelativeUrl() for x in follow_up_list])\n
   # edit document   \n
   if document_edit_kw is not {}:\n
     document.edit(**document_edit_kw)\n
diff --git a/bt5/erp5_ingestion/bt/revision b/bt5/erp5_ingestion/bt/revision
index 0aeb548544..a76c74dcec 100644
--- a/bt5/erp5_ingestion/bt/revision
+++ b/bt5/erp5_ingestion/bt/revision
@@ -1 +1 @@
-74
\ No newline at end of file
+75
\ No newline at end of file
-- 
2.30.9