Commit 36c526f3 authored by 's avatar

Added a fix to HTTPRequest.resolve_url, to correctly return an

object rather than it's default index_html.
parent a9bee0fa
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
# attributions are listed in the accompanying credits file. # attributions are listed in the accompanying credits file.
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.7 $'[11:-2] __version__='$Revision: 1.8 $'[11:-2]
import regex, sys, os import regex, sys, os
from string import lower, atoi, rfind, split, strip, join, upper, find from string import lower, atoi, rfind, split, strip, join, upper, find
...@@ -350,12 +350,15 @@ class HTTPRequest(BaseRequest): ...@@ -350,12 +350,15 @@ class HTTPRequest(BaseRequest):
# waaa - traversal may return a "default object" # waaa - traversal may return a "default object"
# like an index_html document, though you really # like an index_html document, though you really
# wanted to get a Folder back :( # wanted to get a Folder back :(
if callable(object.id): if hasattr(object, 'id'):
name=object.id() if callable(object.id):
else: name=object.id name=object.id()
if name != os.path.split(path)[-1] and \ else: name=object.id
hasattr(object, 'aq_parent'): elif hasattr(object, '__name__'):
return object.aq_parent name=object.__name__
else: name=''
if name != os.path.split(path)[-1]:
return req.PARENTS[0]
return object return object
raise rsp.errmsg, sys.exc_value raise rsp.errmsg, sys.exc_value
......
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