[Erp5-report] r39724 jm - in /erp5/trunk/products: ERP5/Document/ ERP5Security/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Sun Oct 31 16:07:35 CET 2010


Author: jm
Date: Sun Oct 31 16:07:35 2010
New Revision: 39724

URL: http://svn.erp5.org?rev=39724&view=rev
Log:
Fix removal of reference on persons

Modified:
    erp5/trunk/products/ERP5/Document/Person.py
    erp5/trunk/products/ERP5Security/tests/testERP5Security.py

Modified: erp5/trunk/products/ERP5/Document/Person.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Person.py?rev=39724&r1=39723&r2=39724&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Person.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Person.py [utf8] Sun Oct 31 16:07:35 2010
@@ -170,10 +170,11 @@ class Person(EncryptedPasswordMixin, XML
         - we want to prevent duplicated user ids, but only when
           PAS _AND_ ERP5UserManager are used
       """
+      activate_kw = {}
       if value:
         # Encode reference to hex to prevent uppercase/lowercase conflict in
         # activity table (when calling countMessageWithTag)
-        tag = 'Person_setReference_%s' % value.encode('hex')
+        activate_kw['tag'] = tag = 'Person_setReference_' + value.encode('hex')
         # Check that there no existing user
         acl_users = getToolByName(self, 'acl_users')
         if PluggableAuthService is not None and isinstance(acl_users,
@@ -203,11 +204,9 @@ class Person(EncryptedPasswordMixin, XML
           raise RuntimeError, 'user id %s already exist' % (value,)
         else:
           transactional_variable[tag] = None
-      else:
-        tag = None
 
       self._setReference(value)
-      self.reindexObject(activate_kw={'tag': tag})
+      self.reindexObject(activate_kw=activate_kw)
       # invalid the cache for ERP5Security
       portal_caches = getToolByName(self.getPortalObject(), 'portal_caches')
       portal_caches.clearCache(cache_factory_list=('erp5_content_short', ))

Modified: erp5/trunk/products/ERP5Security/tests/testERP5Security.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Security/tests/testERP5Security.py?rev=39724&r1=39723&r2=39724&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Security/tests/testERP5Security.py [utf8] (original)
+++ erp5/trunk/products/ERP5Security/tests/testERP5Security.py [utf8] Sun Oct 31 16:07:35 2010
@@ -404,8 +404,8 @@ class TestUserManagement(ERP5TypeTestCas
 
   def test_PersonLoginIsPossibleToUnset(self):
     """Make sure that it is possible to remove reference"""
-    p = self._makePerson(reference='foo', password='secret',)
-    p.setReference(None)
+    person = self._makePerson(reference='foo', password='secret',)
+    person.setReference(None)
     transaction.commit()
     self.tic()
     self.assertEqual(None, person.getReference())




More information about the Erp5-report mailing list