aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/views.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-03-21 16:16:02 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:53 +1200
commitb2a67d718cbbe004a940145fc12ccfac56490765 (patch)
treecb57e15573d1561ec547cee662e3e9160d66de68 /layerindex/views.py
parent88467d1ab97ff5a34b19306edc7b198bda86a222 (diff)
downloadopenembedded-core-contrib-b2a67d718cbbe004a940145fc12ccfac56490765.tar.gz
Add link to maintenance plan in layer detail
If the RRS is enabled, then add a way to get from the layer detail page to any maintenance plans in which the layer is included. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/views.py')
-rw-r--r--layerindex/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/layerindex/views.py b/layerindex/views.py
index 74cccd589c..cedc5b0009 100644
--- a/layerindex/views.py
+++ b/layerindex/views.py
@@ -368,6 +368,10 @@ class LayerDetailView(DetailView):
context['updates'] = layerbranch.layerupdate_set.order_by('-started')
context['url_branch'] = self.kwargs['branch']
context['this_url_name'] = resolve(self.request.path_info).url_name
+ if 'rrs' in settings.INSTALLED_APPS:
+ from rrs.models import MaintenancePlanLayerBranch
+ # We don't care about branch, only that the layer is included
+ context['rrs_maintplans'] = [m.plan for m in MaintenancePlanLayerBranch.objects.filter(layerbranch__layer=layer)]
return context
class LayerReviewDetailView(LayerDetailView):