[Checkins] SVN: z3c.layer.pagelet/trunk/ Doing redirect in ``UnauthorizedPagelet`` now in ``update`` method instead of ``render`` so the layout templage does not get rendered when redirecting.

Michael Howitz mh at gocept.com
Mon Oct 11 05:36:19 EDT 2010


Log message for revision 117428:
  Doing redirect in ``UnauthorizedPagelet`` now in ``update`` method instead of ``render`` so the layout templage does not get rendered when redirecting.
  
  

Changed:
  U   z3c.layer.pagelet/trunk/CHANGES.txt
  U   z3c.layer.pagelet/trunk/src/z3c/layer/pagelet/browser/__init__.py

-=-
Modified: z3c.layer.pagelet/trunk/CHANGES.txt
===================================================================
--- z3c.layer.pagelet/trunk/CHANGES.txt	2010-10-11 09:34:08 UTC (rev 117427)
+++ z3c.layer.pagelet/trunk/CHANGES.txt	2010-10-11 09:36:19 UTC (rev 117428)
@@ -5,11 +5,17 @@
 1.8.1 (unreleased)
 ------------------
 
+- Doing redirect in ``UnauthorizedPagelet`` now in ``update`` method instead
+  of ``render`` so the layout templage does not get rendered when
+  redirecting.
+
 - Fixed tests: Using manager account, so anonymous user does not need to get
   all permissions for running tests successfully.
 
 - Got rid of `zope.app.testing` test dependency by using `zope.app.wsgi`.
 
+- Got rid of `zope.app.authentication` test dependency.
+
 - Added a test for ``403 Forbidden``.
 
 1.8.0 (2010-08-20)

Modified: z3c.layer.pagelet/trunk/src/z3c/layer/pagelet/browser/__init__.py
===================================================================
--- z3c.layer.pagelet/trunk/src/z3c/layer/pagelet/browser/__init__.py	2010-10-11 09:34:08 UTC (rev 117427)
+++ z3c.layer.pagelet/trunk/src/z3c/layer/pagelet/browser/__init__.py	2010-10-11 09:36:19 UTC (rev 117428)
@@ -38,7 +38,7 @@
 
     zope.interface.implements(interfaces.IUnauthorizedPagelet)
 
-    def render(self):
+    def update(self):
         # Set the error status to 403 (Forbidden) in the case when we don't
         # challenge the user
         self.request.response.setStatus(403)
@@ -54,6 +54,8 @@
         auth = zope.component.getUtility(
             zope.authentication.interfaces.IAuthentication)
         auth.unauthorized(principal.id, self.request)
+
+    def render(self):
         if self.request.response.getStatus() not in (302, 303):
             template = zope.component.getMultiAdapter(
                 (self, self.request), z3c.template.interfaces.IContentTemplate)



More information about the checkins mailing list