Commit 9dbe7dab authored by Vincent Pelletier's avatar Vincent Pelletier

Instead of raising, redirect user to document with an error message in portal status.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24706 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 67754904
...@@ -67,14 +67,15 @@ ...@@ -67,14 +67,15 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
request = context.REQUEST\n
N_ = context.Base_translateString\n
\n
from AccessControl import getSecurityManager\n from AccessControl import getSecurityManager\n
u=getSecurityManager().getUser()\n u=getSecurityManager().getUser()\n
ADD_PERMISSION = \'Add portal content\'\n ADD_PERMISSION = \'Add portal content\'\n
if not u.has_permission(ADD_PERMISSION,context):\n if not u.has_permission(ADD_PERMISSION,context):\n
raise ValueError, "How did you manage to be there ???"\n request[ \'RESPONSE\' ].redirect(\'%s/view?portal_status_message=%s\' % (context.absolute_url(), N_("You can\'t modify that document any longer.")))\n
\n return\n
request = context.REQUEST\n
N_ = context.Base_translateString\n
\n \n
def recurse(document):\n def recurse(document):\n
result = document.hasActivity()\n result = document.hasActivity()\n
...@@ -410,20 +411,19 @@ else:\n ...@@ -410,20 +411,19 @@ else:\n
<string>listbox</string> <string>listbox</string>
<string>form_id</string> <string>form_id</string>
<string>kw</string> <string>kw</string>
<string>AccessControl</string>
<string>getSecurityManager</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>u</string>
<string>ADD_PERMISSION</string>
<string>context</string> <string>context</string>
<string>ValueError</string>
<string>request</string> <string>request</string>
<string>N_</string> <string>N_</string>
<string>AccessControl</string>
<string>getSecurityManager</string>
<string>u</string>
<string>ADD_PERMISSION</string>
<string>_getitem_</string>
<string>recurse</string> <string>recurse</string>
<string>deleteContent</string> <string>deleteContent</string>
<string>cell_base_id</string> <string>cell_base_id</string>
<string>line_kwd</string> <string>line_kwd</string>
<string>_getitem_</string>
<string>variation_list</string> <string>variation_list</string>
<string>emission_letter_list</string> <string>emission_letter_list</string>
<string>cash_status_list</string> <string>cash_status_list</string>
......
469 472
\ 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