From: Zooko O'Whielacronx Date: Tue, 7 Apr 2009 18:28:34 +0000 (-0700) Subject: wui: fix bug in which empty directory is marked as "unreadable", add test, remove... X-Git-Tag: allmydata-tahoe-1.4.0~21 X-Git-Url: https://git.rkrishnan.org/specifications/components?a=commitdiff_plain;h=8b1cd154da0854de8175c03c942f8b2edf6fc772;p=tahoe-lafs%2Ftahoe-lafs.git wui: fix bug in which empty directory is marked as "unreadable", add test, remove exclamation point --- 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