Commit 6af566f8 authored by Mame Coumba Sall's avatar Mame Coumba Sall

Modified to avoid too many functions or groups set when contributing a document.

parent 76ce5e7f
...@@ -56,11 +56,20 @@ User would be usually the current user, but sometimes the name has to be given e ...@@ -56,11 +56,20 @@ User would be usually the current user, but sometimes the name has to be given e
if e.g. the doc is contributed by email, and the script is run by zope user.\n if e.g. the doc is contributed by email, and the script is run by zope user.\n
"""\n """\n
assignment_dict = context.ERP5Site_getPersonAssignmentDict(user_name=user_name)\n assignment_dict = context.ERP5Site_getPersonAssignmentDict(user_name=user_name)\n
group_list = assignment_dict[\'group_list\']\n
\n \n
# XXX: make list of properties configurable through preferences\n group_level_dict = {}\n
return {\'group_list\': assignment_dict[\'group_list\'],\n for group in group_list:\n
\'site_list\': assignment_dict[\'site_list\'],\n group_level = len(group.split("/"))\n
\'function_list\': assignment_dict[\'function_list\']}\n group_level_dict[group] = group_level\n
\n
\n
#Get the highest levels groups of the assignments\n
##if group_list = [\'nexedi\', \'nexedi/hq\', \'nexedi/jp\'] returns [\'nexedi\']\n
##if group_list = [\'nexedi/hq\', \'nexedi/jp\'] returns [\'nexedi/hq\', \'nexedi/jp\']\n
highest_level_group_value = min(group_level_dict.itervalues())\n
highest_level_groups = [k for k in group_level_dict if group_level_dict[k] == highest_level_group_value]\n
return {\'group_list\': highest_level_groups}\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
151 152
\ 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