Commit 493a069e authored by Chris McDonough's avatar Chris McDonough

Raise error in _getobcontext if request.steps is len(0)... if someone deletes...

Raise error in _getobcontext if request.steps is len(0)... if someone deletes the root index_html, they will no longer get a puzzling failure if they attempt to view an object without an acquirable index_html.
parent 012baf7a
......@@ -84,7 +84,7 @@
##############################################################################
"""Access control package"""
__version__='$Revision: 1.139 $'[11:-2]
__version__='$Revision: 1.140 $'[11:-2]
import Globals, socket, ts_regex, SpecialUsers
import os
......@@ -674,6 +674,9 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
a is the object the object was accessed through
c is the physical container of the object
"""
if len(request.steps) == 0: # someone deleted root index_html
request.RESPONSE.notFoundError('no default view (root index_html'
' was probably deleted)')
n = request.steps[-1]
# default to accessed and container as v.aq_parent
a = c = request['PARENTS'][0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment