mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-11 23:03:53 +00:00
WUI: fix display of empty directories, it threw an exception before
This commit is contained in:
parent
4f4d748fd9
commit
6599eae6f9
@ -914,6 +914,12 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase):
|
|||||||
'</td>\s+<td>DIR-RO</td>', res))
|
'</td>\s+<td>DIR-RO</td>', res))
|
||||||
d.addCallback(_check3)
|
d.addCallback(_check3)
|
||||||
|
|
||||||
|
# and an empty directory
|
||||||
|
d.addCallback(lambda res: self.GET(self.public_url + "/foo/empty/"))
|
||||||
|
def _check4(res):
|
||||||
|
self.failUnless("directory is empty!" in res, res)
|
||||||
|
d.addCallback(_check4)
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def test_GET_DIRURL_badtype(self):
|
def test_GET_DIRURL_badtype(self):
|
||||||
|
@ -550,7 +550,7 @@ class DirectoryAsHTML(rend.Page):
|
|||||||
def render_try_children(self, ctx, data):
|
def render_try_children(self, ctx, data):
|
||||||
# if the dirnode can be retrived, render a table of children.
|
# if the dirnode can be retrived, render a table of children.
|
||||||
# Otherwise, render an apologetic error message.
|
# Otherwise, render an apologetic error message.
|
||||||
if self.dirnode_children:
|
if self.dirnode_children is not None:
|
||||||
return ctx.tag
|
return ctx.tag
|
||||||
else:
|
else:
|
||||||
return T.div[T.p["Error reading directory:"],
|
return T.div[T.p["Error reading directory:"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user