aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-09-25 16:10:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-29 14:11:20 +0100
commitafa2431c21b8271b05dc4cca4265f98d9f338007 (patch)
tree65deac3b7bef3d52ef7f29adc04ea90a4a76f2c8
parentfae5914030bcf4c061c22fc61034c40c87b7121a (diff)
downloadbitbake-afa2431c21b8271b05dc4cca4265f98d9f338007.tar.gz
toastergui fix size rendering in dirinfo page
We fix the rendering of the size field in dirinfo-related pages by directly calling filtered_filesizeformat and not rendering it through the template engine. Additionally, we enable error dumping into logs if an Exception happens. [YOCTO #6669] Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xlib/toaster/toastergui/views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index defbbbfa4..ea81423d5 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -742,7 +742,6 @@ class LazyEncoder(json.JSONEncoder):
return super(LazyEncoder, self).default(obj)
from toastergui.templatetags.projecttags import filtered_filesizeformat
-from django import template
import os
def _get_dir_entries(build_id, target_id, start):
node_str = {
@@ -797,9 +796,7 @@ def _get_dir_entries(build_id, target_id, start):
# don't use resolved path from above, show immediate link-to
if o.sym_target_id != "" and o.sym_target_id != None:
entry['link_to'] = Target_File.objects.get(pk=o.sym_target_id).path
- t = template.Template('{% load projecttags %} {{ size|filtered_filesizeformat }}')
- c = template.Context({'size': o.size})
- entry['size'] = str(t.render(c))
+ entry['size'] = filtered_filesizeformat(o.size)
if entry['link_to'] != None:
entry['permission'] = node_str[o.inodetype] + o.permission
else:
@@ -808,7 +805,10 @@ def _get_dir_entries(build_id, target_id, start):
entry['group'] = o.group
response.append(entry)
- except:
+ except Exception as e:
+ print "Exception ", e
+ import traceback
+ traceback.print_exc(e)
pass
# sort by directories first, then by name