Commit 108264d2 authored by Nicolas Delaby's avatar Nicolas Delaby

Fix script if user is not found in person module

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21124 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6b14f96a
...@@ -71,8 +71,10 @@ from AccessControl import getSecurityManager\n ...@@ -71,8 +71,10 @@ from AccessControl import getSecurityManager\n
# Search current user ID\n # Search current user ID\n
user_id = getSecurityManager().getUser().getId()\n user_id = getSecurityManager().getUser().getId()\n
source = None\n source = None\n
person_subordination = None\n
for person in context.portal_catalog(reference=user_id, portal_type=\'Person\'):\n for person in context.portal_catalog(reference=user_id, portal_type=\'Person\'):\n
source = person.getRelativeUrl()\n source = person.getRelativeUrl()\n
person_subordination = person.getSubordination()\n
break\n break\n
\n \n
follow_up_url = None\n follow_up_url = None\n
...@@ -83,14 +85,14 @@ destination = context.getRelativeUrl()\n ...@@ -83,14 +85,14 @@ destination = context.getRelativeUrl()\n
\n \n
if direction == \'out\':\n if direction == \'out\':\n
source_url = source\n source_url = source\n
source_section_url = person.getSubordination()\n source_section_url = person_subordination\n
destination_url = destination\n destination_url = destination\n
destination_section_url = context.getSubordination()\n destination_section_url = context.getSubordination()\n
elif direction == \'in\':\n elif direction == \'in\':\n
source_url = destination\n source_url = destination\n
source_section_url = context.getSubordination()\n source_section_url = context.getSubordination()\n
destination_url = source\n destination_url = source\n
destination_section_url = person.getSubordination()\n destination_section_url = person_subordination\n
else:\n else:\n
raise KeyError, \'Direction Specified not handling: %s\' % direction\n raise KeyError, \'Direction Specified not handling: %s\' % direction\n
\n \n
...@@ -175,6 +177,7 @@ event.Base_redirect(keep_items={\'portal_status_message\': message})\n ...@@ -175,6 +177,7 @@ event.Base_redirect(keep_items={\'portal_status_message\': message})\n
<string>user_id</string> <string>user_id</string>
<string>None</string> <string>None</string>
<string>source</string> <string>source</string>
<string>person_subordination</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>context</string> <string>context</string>
<string>person</string> <string>person</string>
......
237 239
\ 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