X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/41b0ce79349f032cab45b959dab4a67c0820b9c8..fc2db7db9ed40b111c26d51eccd94641a194a153:/profiles/photo/various.py

diff --git a/profiles/photo/various.py b/profiles/photo/various.py
index 8141a6d..819cc4b 100644
--- a/profiles/photo/various.py
+++ b/profiles/photo/various.py
@@ -102,13 +102,16 @@ caltool = getToolByName(site, 'portal_calendar')
 caltool.configureTool(['created', 'modified', 'DateTimeOriginal'], [9, 18])
 
 pimtool = getToolByName(site, 'portal_image_manipulation')
-pimtool.manage_addProduct['OFSP'].manage_addFolder('image')
-pimtool.manage_addProduct['OFSP'].manage_addFolder('tile')
+if not pimtool.hasObject('image') :
+	pimtool.manage_addProduct['OFSP'].manage_addFolder('image')
+if not pimtool.hasObject('tile') :
+	pimtool.manage_addProduct['OFSP'].manage_addFolder('tile')
 
 ctool = getToolByName(site, 'portal_catalog')
-ctool.manage_addProduct['ProxyIndex'].manage_addProxyIndex('position',
-        extra = { 'idx_type' : 'FieldIndex'
-                , 'value_expr' : 'python:object.getParentNode().getObjectPosition(object.getId())'})
+if not 'position' in ctool.indexes() :
+	ctool.manage_addProduct['ProxyIndex'].manage_addProxyIndex('position',
+	        extra = { 'idx_type' : 'FieldIndex'
+	                , 'value_expr' : 'python:object.getParentNode().getObjectPosition(object.getId())'})
 
 # Caches
 HTTPCache = site.HTTPCache