[bitbake-devel,8/9] toaster: fix dirinfo empty dir expansion

Submitted by Alexandru DAMIAN on March 27, 2014, 4:50 p.m.


Message ID 528163262263bf5315b8c1f3822dff7eb15d9e81.1395938903.git.alexandru.damian@intel.com
State New
Headers show

Commit Message

Alexandru DAMIAN March 27, 2014, 4:50 p.m.
From: Dave Lerner <dave.lerner@windriver.com>

[YOCTO 6036]

In the page that shows the directory layout for an image, if the
directory is empty, then the directory folder icon should be black and
the table row should not be 'expandable' on a mouse click.  That
behavior depends on the directory's child entry count calculated in the
view function controlling that page.

Two images in the database with the same directory path in the target
image, but one with path having entries and the other not having
any entries caused the path without entries to be clickable; the
query for a directory's count of entries, didn't filter on the image id,
only on the path.

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
 lib/toaster/toastergui/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index d323b37..4f7170b 100644
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -646,7 +646,7 @@  def _get_dir_entries(build_id, target_id, start):
             if o.inodetype == Target_File.ITYPE_DIRECTORY:
                 entry['isdir'] = 1
                 # is there content in directory
-                entry['childcount'] = Target_File.objects.filter(directory__path=o.path).all().count()
+                entry['childcount'] = Target_File.objects.filter(target__exact=target_id, directory__path=o.path).all().count()
                 entry['isdir'] = 0