[kupu-checkins] r43493 - in kupu/trunk/kupu: . doc plone/kupu_plone_layer

duncan at codespeak.net duncan at codespeak.net
Fri May 18 17:37:57 CEST 2007


Author: duncan
Date: Fri May 18 17:37:56 2007
New Revision: 43493

Modified:
   kupu/trunk/kupu/   (props changed)
   kupu/trunk/kupu/doc/CHANGES.txt
   kupu/trunk/kupu/plone/kupu_plone_layer/resolveuid.py
Log:
resolveuid now generates a proper 404 error for unrecognised uids.
If no uid is specified it now throws an unauthorised error (Plone issue 6103).

Modified: kupu/trunk/kupu/doc/CHANGES.txt
==============================================================================
--- kupu/trunk/kupu/doc/CHANGES.txt	(original)
+++ kupu/trunk/kupu/doc/CHANGES.txt	Fri May 18 17:37:56 2007
@@ -20,7 +20,7 @@
     <br> tags are left unchanged (so those people who insist on using
     the to generate whitespace still can).
 
-  - Plone tickets: 5420
+  - Plone tickets: 5420, 6056, 6103
 
 - 1.4 Beta 6
 

Modified: kupu/trunk/kupu/plone/kupu_plone_layer/resolveuid.py
==============================================================================
--- kupu/trunk/kupu/plone/kupu_plone_layer/resolveuid.py	(original)
+++ kupu/trunk/kupu/plone/kupu_plone_layer/resolveuid.py	Fri May 18 17:37:56 2007
@@ -9,11 +9,16 @@
 # (reference_url is supposed to do the same thing, but is broken)
 from Products.CMFCore.utils import getToolByName
 from Products.PythonScripts.standard import html_quote
+from AccessControl import Unauthorized
 
 request = context.REQUEST
 response = request.RESPONSE
 
-uuid = traverse_subpath.pop(0)
+try:
+    uuid = traverse_subpath.pop(0)
+except:
+    raise Unauthorized, context
+
 reference_tool = getToolByName(context, 'reference_catalog')
 obj = reference_tool.lookupObject(uuid)
 if not obj:
@@ -21,8 +26,7 @@
     if hook:
         obj = hook(uuid)
     if not obj:
-        return context.standard_error_message(error_type=404,
-            error_message='''The link you followed appears to be broken''')
+        return response.notFoundError('''The link you followed appears to be broken''')
 
 if traverse_subpath:
     traverse_subpath.insert(0, obj.absolute_url())


More information about the kupu-checkins mailing list