[Checkins] SVN: Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBRoleManager.py added proper condition to logger call

Andreas Jung andreas at andreas-jung.com
Thu Mar 6 11:31:05 EST 2008


Log message for revision 84511:
  added proper condition to logger call
  

Changed:
  U   Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBRoleManager.py

-=-
Modified: Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBRoleManager.py
===================================================================
--- Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBRoleManager.py	2008-03-06 16:29:44 UTC (rev 84510)
+++ Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBRoleManager.py	2008-03-06 16:31:03 UTC (rev 84511)
@@ -276,9 +276,10 @@
                 parent = aq_parent( self )
                 info = parent.searchPrincipals( id=k, exact_match=True )
 
-                LOG.error('searchPrincipals() returned more than one result '
-                          'for id=%s' % k)
-                assert len(info) <= 1
+                if len(info) > 1:
+                    LOG.error('searchPrincipals() returned more than one result '
+                              'for id=%s' % k)
+                assert len(info) in (0, 1)
                 if len( info ) == 0:
                     title = '<%s: not found>' % k
                 else:



More information about the Checkins mailing list