[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/publication/zopepublication.py In handleException, it's ok if there's no user for the request.

Shane Hathaway shane at zope.com
Wed Nov 10 00:42:44 EST 2004


Log message for revision 28415:
  In handleException, it's ok if there's no user for the request.
  
  Otherwise Zope can't report that there is no default user (it breaks 
  in handleException)
  

Changed:
  U   Zope3/trunk/src/zope/app/publication/zopepublication.py

-=-
Modified: Zope3/trunk/src/zope/app/publication/zopepublication.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/zopepublication.py	2004-11-09 21:47:43 UTC (rev 28414)
+++ Zope3/trunk/src/zope/app/publication/zopepublication.py	2004-11-10 05:42:42 UTC (rev 28415)
@@ -170,7 +170,8 @@
         This method is not part of the `IPublication` interface, since
         it's specific to this particular implementation.
         """
-        txn.setUser(request.principal.id)
+        if request.principal is not None:
+            txn.setUser(request.principal.id)
 
         # Work around methods that are usually used for views
         bare = removeSecurityProxy(ob)



More information about the Zope3-Checkins mailing list