[Zope-Checkins] CVS: Zope/lib/python/OFS - ObjectManager.py:1.141.22.1

Tres Seaver tseaver@zope.com
Mon, 15 Oct 2001 19:07:37 -0400


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv13749/lib/python/OFS

Modified Files:
      Tag: tseaver-utxfixup-branch
	ObjectManager.py 
Log Message:


  - Don't assume that a user object is obtainable when adding objects
    (the behavior was optional in both cases, anyway).


=== Zope/lib/python/OFS/ObjectManager.py 1.141 => 1.141.22.1 ===
                 if object.__ac_local_roles__ is None:
                     user=getSecurityManager().getUser()
-                    name=user.getUserName()
-                    if name != 'Anonymous User':
-                        object.manage_setLocalRoles(name, ['Owner'])
+                    if user is not None:
+                        name=user.getUserName()
+                        if name != 'Anonymous User':
+                            object.manage_setLocalRoles(name, ['Owner'])
 
         object.manage_afterAdd(object, self)
         return id