Commit 5d383247 authored by Łukasz Nowak's avatar Łukasz Nowak

- support case of adding roles in case of first reindexation when reference

   is set

In such scenario getUserById returns None, even if Person document with
reference is added.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36980 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 097024ed
......@@ -125,7 +125,12 @@ class IndexableObjectWrapper(object):
for user, roles in localroles.iteritems():
prefix = 'user:' + user
for role in roles:
if (role in role_dict) and (getUserById(user) is not None):
if (role in role_dict) and (getUserById(user) is not None
# support special case - reindex person for first time, when
# it is not returned yet by getUserById, as it is not available
# yet in catalog
or (self.getPortalType()=='Person' and
self.getReference() == user)):
# If role is monovalued, check if key is a user.
# If not, continue to index it in roles_and_users table.
user_role_dict[role] = user
......
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