From 78bd592680e869f79d2667f192a08f8749d04615 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 10 Jan 2018 14:40:18 +0100
Subject: [PATCH] notification tool: get only ERP5 objects when looking for
 users

---
 product/ERP5/Tool/NotificationTool.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/Tool/NotificationTool.py b/product/ERP5/Tool/NotificationTool.py
index 59231b0cb8..15f3a3c8be 100644
--- a/product/ERP5/Tool/NotificationTool.py
+++ b/product/ERP5/Tool/NotificationTool.py
@@ -291,7 +291,8 @@ class NotificationTool(BaseTool):
     portal = self.getPortalObject()
     searchUsers = self.acl_users.searchUsers
     def getUserValueByUserId(user_id):
-      user, = searchUsers(id=user_id, exact_match=True)
+      user, = [x for x in searchUsers(id=user_id, exact_match=True,
+               login_portal_type=portal.getPortalLoginTypeList()) if 'path' in x]
       return portal.unrestrictedTraverse(user['path'])
 
     if notifier_list is None:
-- 
2.30.9