Commit 9d92f7e9 authored by Romain Courteaud's avatar Romain Courteaud

Only calls listFolderContents in the context of a Preference (to delete Template).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28566 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6050ddee
...@@ -53,23 +53,19 @@ ...@@ -53,23 +53,19 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string># XXX This is a hack which allow to delete non indexed Template\n
# Never call listFolderContents in a place where there could be million of\n
result = context.portal_catalog(**kw)\n # documents!\n
\n if context.getPortalType() == \'Preference\':\n
if len(result)>0:\n result = []\n
uid_list = kw.get(\'uid\', [])\n
for i in context.listFolderContents():\n
if i.getUid() in uid_list:\n
result.append(i)\n
return result\n return result\n
\n else:\n
result = []\n return context.portal_catalog(**kw)\n
uid_list = kw.get(\'uid\', [])\n </string> </value>
for i in context.listFolderContents():\n
if i.getUid() in uid_list:\n
result.append(i)\n
\n
return result\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -106,14 +102,13 @@ return result\n ...@@ -106,14 +102,13 @@ return result\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>result</string> <string>result</string>
<string>len</string>
<string>uid_list</string> <string>uid_list</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>i</string> <string>i</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
1283 1284
\ 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