From 8b1cd154da0854de8175c03c942f8b2edf6fc772 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Tue, 7 Apr 2009 11:28:34 -0700 Subject: [PATCH] wui: fix bug in which empty directory is marked as "unreadable", add test, remove exclamation point --- src/allmydata/test/test_web.py | 4 +++- src/allmydata/web/directory.py | 2 +- src/allmydata/web/directory.xhtml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index ef0b616a..d4d6cdbe 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -917,7 +917,9 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): # 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) + self.failUnless("directory is empty" in res, res) + MKDIR_BUTTON_RE=re.compile('.*Create a new directory.*', re.I) + self.failUnless(MKDIR_BUTTON_RE.search(res), res) d.addCallback(_check4) return d diff --git a/src/allmydata/web/directory.py b/src/allmydata/web/directory.py index 51837b11..20418194 100644 --- a/src/allmydata/web/directory.py +++ b/src/allmydata/web/directory.py @@ -658,7 +658,7 @@ class DirectoryAsHTML(rend.Page): if self.node.is_readonly(): return T.div["No upload forms: directory is read-only"] - if not self.dirnode_children: + if self.dirnode_children is None: return T.div["No upload forms: directory is unreadable"] mkdir = T.form(action=".", method="post", diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml index 6038cd3f..db74d06d 100644 --- a/src/allmydata/web/directory.xhtml +++ b/src/allmydata/web/directory.xhtml @@ -38,7 +38,7 @@ - directory is empty! + directory is empty -- 2.45.2