[Zope3-checkins] CVS: Zope3/src/zope/app/services - error.py:1.4.2.1

Marius Gedminas marius at pov.lt
Fri Mar 19 13:51:23 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv26650/src/zope/app/services

Modified Files:
      Tag: mgedmin-events2-branch
	error.py 
Log Message:
Added IParticipation and replaced the lists of principals in IInteraction with
a list of participations.  Made BaseRequest an IParticipation and replaced
request.user with request.principal everywhere.



=== Zope3/src/zope/app/services/error.py 1.4 => 1.4.2.1 ===
--- Zope3/src/zope/app/services/error.py:1.4	Fri Feb 20 11:57:30 2004
+++ Zope3/src/zope/app/services/error.py	Fri Mar 19 13:50:50 2004
@@ -105,18 +105,18 @@
                     url = request.URL
                 try:
                     # XXX: UnauthenticatedPrincipal does not have getLogin()
-                    if hasattr(request.user, 'getLogin'):
-                        login = request.user.getLogin()
+                    if hasattr(request.principal, 'getLogin'):
+                        login = request.principal.getLogin()
                     else:
                         login = 'unauthenticated'
                     username = ', '.join(map(str, (login,
-                                          request.user.getId(),
-                                          request.user.getTitle(),
-                                          request.user.getDescription()
+                                          request.principal.getId(),
+                                          request.principal.getTitle(),
+                                          request.principal.getDescription()
                                          )))
-                # When there's an unauthorized access, request.user is
+                # When there's an unauthorized access, request.principal is
                 # not set, so we get an AttributeError
-                # XXX is this right? Surely request.user should be set!
+                # XXX is this right? Surely request.principal should be set!
                 # XXX Answer: Catching AttributeError is correct for the
                 #             simple reason that UnauthenticatedUser (which
                 #             I always use during coding), has no 'getLogin()'




More information about the Zope3-Checkins mailing list