summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/tables.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-10-09 10:32:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-11 08:11:29 +0100
commitab896df63ba058f535cb303611574f293c7c680b (patch)
treecacd7c759774a8578e532a41c5ce0e26226040a0 /bitbake/lib/toaster/toastergui/tables.py
parent41a5f82b4ac0c689df4cfc673ce574c2d70f413c (diff)
downloadpoky-ab896df63ba058f535cb303611574f293c7c680b.tar.gz
bitbake: toaster: Fix stale layer state buttons
Move the "is available to the project" state computation to the template for the Layer add/remove buttons, Recipe build/Add layer as done for the Package add/remove. This is more reliable as we can get an inconsistent state on the front end JS as there are many opportunities for hitting out of date project information. [YOCTO #8294] (Bitbake rev: 43469c3360566ad4897785f14f8717a9bc8b6078) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tables.py')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 4f24772206..b10445b00f 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -57,9 +57,7 @@ class LayersTable(ToasterTable):
57 context = super(LayersTable, self).get_context_data(**kwargs) 57 context = super(LayersTable, self).get_context_data(**kwargs)
58 58
59 project = Project.objects.get(pk=kwargs['pid']) 59 project = Project.objects.get(pk=kwargs['pid'])
60
61 context['project'] = project 60 context['project'] = project
62 context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=project))
63 61
64 return context 62 return context
65 63
@@ -93,7 +91,10 @@ class LayersTable(ToasterTable):
93 91
94 def setup_queryset(self, *args, **kwargs): 92 def setup_queryset(self, *args, **kwargs):
95 prj = Project.objects.get(pk = kwargs['pid']) 93 prj = Project.objects.get(pk = kwargs['pid'])
96 compatible_layers = prj.compatible_layerversions() 94 compatible_layers = prj.get_all_compatible_layer_versions()
95
96 self.static_context_extra['current_layers'] = \
97 prj.get_project_layer_versions(pk=True)
97 98
98 self.queryset = compatible_layers.order_by(self.default_orderby) 99 self.queryset = compatible_layers.order_by(self.default_orderby)
99 100