From 19dc4415d74b1e8731cc036d34fecba791dd6ff3 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 2 Feb 2018 15:07:05 +0900
Subject: [PATCH] Person: Fix _setReference modification detection.

Also, simplify docstring.
---
 product/ERP5/Document/Person.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/product/ERP5/Document/Person.py b/product/ERP5/Document/Person.py
index b4e0147a6c..5faf138739 100644
--- a/product/ERP5/Document/Person.py
+++ b/product/ERP5/Document/Person.py
@@ -181,14 +181,11 @@ class Person(Node, LoginAccountProviderMixin, EncryptedPasswordMixin, ERP5UserMi
 
     def _setReference(self, value):
       """
-        Set the user id. This method is defined explicitly, because:
-
-        - we want to apply a different permission
-
-        - we want to prevent duplicated user ids, but only when
-          PAS _AND_ ERP5UserManager are used
+        Set the user id. This method is defined explicitly, because
+        we want to prevent duplicated user ids, but only when
+        PAS _AND_ ERP5UserManager are used
       """
-      if value != self.getUserId():
+      if value != self.getReference():
         if value:
           self.__checkUserIdAvailability(
             pas_plugin_class=ERP5UserManager,
-- 
2.30.9