Commit 2883a076 authored by Aurel's avatar Aurel

Make sure that the user launching a synchronization is defined in

user_folder

This prevents the synchronization to end later without giving any explanation
parent 486b06bd
......@@ -1110,8 +1110,13 @@ class SynchronizationTool(BaseTool):
subscription.initLastMessageId()
# save the actual user to use it in all the session:
user = getSecurityManager().getUser()
subscription._edit(zope_user=user.getId())
user_id = getSecurityManager().getUser().getId()
user_folder = self.getPortalObject().acl_users
user = user_folder.getUserById(user_id)
if user is None:
raise ValueError, "Current logged user %s cannot be found in user folder, \
synchronization cannot work with this kind of user"
subscription._edit(zope_user=user_id)
if subscription.getAuthenticationState() != 'logged_in':
subscription.login()
......
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