[Checkins] SVN: Products.PluggableAuthService/trunk/ Return the created user in _doAddUser, to match change in AccessControl 2.13.4.

Maurits van Rees m.van.rees at zestsoftware.nl
Mon Jan 10 18:53:24 EST 2011


Log message for revision 119485:
  Return the created user in _doAddUser, to match change in AccessControl 2.13.4.
  

Changed:
  U   Products.PluggableAuthService/trunk/CHANGES.txt
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/PluggableAuthService.py
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/ChallengeProtocolChooser.txt

-=-
Modified: Products.PluggableAuthService/trunk/CHANGES.txt
===================================================================
--- Products.PluggableAuthService/trunk/CHANGES.txt	2011-01-10 23:51:29 UTC (rev 119484)
+++ Products.PluggableAuthService/trunk/CHANGES.txt	2011-01-10 23:53:23 UTC (rev 119485)
@@ -4,6 +4,9 @@
 1.7.3 (unreleased)
 ------------------
 
+- Return the created user in _doAddUser, to match change in
+  AccessControl 2.13.4.
+
 - Fixed possible ``binascii.Error`` in ``extractCredentials`` of
   CookieAuthHelper. This is a corner case that might happen after
   a browser upgrade.

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/PluggableAuthService.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/PluggableAuthService.py	2011-01-10 23:51:29 UTC (rev 119484)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/PluggableAuthService.py	2011-01-10 23:53:23 UTC (rev 119485)
@@ -951,6 +951,8 @@
                 break
 
         # XXX What should we do if no useradder was succesfull?
+        if user is None:
+            return
 
         for roleassigner_id, roleassigner in roleassigners:
             for role in roles:
@@ -965,8 +967,8 @@
 
         if user is not None:
             notify(PrincipalCreated(user))
+        return user
 
-
     security.declarePublic('all_meta_types')
     def all_meta_types(self):
         """ What objects can be put in here?

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/ChallengeProtocolChooser.txt
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/ChallengeProtocolChooser.txt	2011-01-10 23:51:29 UTC (rev 119484)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/tests/ChallengeProtocolChooser.txt	2011-01-10 23:53:23 UTC (rev 119485)
@@ -60,7 +60,7 @@
 
   >>> username, password  = 'test_user_', 'test_user_pw'
   >>> pas._doAddUser(username, password, ['Manager'], [])
-
+  <PropertiedUser 'test_user_'>
   >>> pas.getUserById('test_user_') is None
   False
 



More information about the checkins mailing list