Commit 2df0bd51 authored by Łukasz Nowak's avatar Łukasz Nowak

- do not try to expire category if transition is not possible

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32760 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd9852f5
...@@ -291,9 +291,14 @@ if not simulation_mode:\n ...@@ -291,9 +291,14 @@ if not simulation_mode:\n
category.edit(**{\'expiration_date\':expiration_date})\n category.edit(**{\'expiration_date\':expiration_date})\n
else:\n else:\n
for category in category_to_delete_list:\n for category in category_to_delete_list:\n
category = context.portal_categories.resolveCategory(category)\n expiration_possible = context.getPortalObject().portal_workflow \\\n
if category is not None:\n .isTransitionPossible(category, \'expire\')\n
category.expire()\n break\n
if expiration_possible:\n
for category in category_to_delete_list:\n
category = context.portal_categories.resolveCategory(category)\n
if category is not None:\n
category.expire()\n
\n \n
\n \n
\n \n
...@@ -428,6 +433,7 @@ return context.REQUEST.RESPONSE.redirect(\n ...@@ -428,6 +433,7 @@ return context.REQUEST.RESPONSE.redirect(\n
<string>category_to_delete_list</string> <string>category_to_delete_list</string>
<string>base_category_id</string> <string>base_category_id</string>
<string>parent</string> <string>parent</string>
<string>expiration_possible</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
1476 1477
\ 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