From 1c68f210bdbe231ef2d993e9bb85e543af3470f8 Mon Sep 17 00:00:00 2001 From: Brandon Lo Date: Wed, 6 Nov 2019 13:05:58 -0500 Subject: Allow public marked grb and configs to be shown Change-Id: I97f4965e8522cac1ceb5c0492e9aa0a2e128d266 Signed-off-by: Brandon Lo --- src/workflow/booking_workflow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/workflow') diff --git a/src/workflow/booking_workflow.py b/src/workflow/booking_workflow.py index 3698164..c96e1b9 100644 --- a/src/workflow/booking_workflow.py +++ b/src/workflow/booking_workflow.py @@ -15,6 +15,7 @@ from booking.models import Booking from workflow.models import WorkflowStep, AbstractSelectOrCreate from workflow.forms import ResourceSelectorForm, SWConfigSelectorForm, BookingMetaForm, OPNFVSelectForm from resource_inventory.models import GenericResourceBundle, ConfigBundle, OPNFVConfig +from django.db.models import Q """ @@ -43,7 +44,7 @@ class Abstract_Resource_Select(AbstractSelectOrCreate): def get_form_queryset(self): user = self.repo_get(self.repo.SESSION_USER) - qs = GenericResourceBundle.objects.filter(owner=user) + qs = GenericResourceBundle.objects.filter(Q(hidden=False) & (Q(owner=user) | Q(public=True))) return qs def get_page_context(self): @@ -82,7 +83,7 @@ class SWConfig_Select(AbstractSelectOrCreate): def get_form_queryset(self): user = self.repo_get(self.repo.SESSION_USER) grb = self.repo_get(self.repo.SELECTED_GRESOURCE_BUNDLE) - qs = ConfigBundle.objects.filter(owner=user).filter(bundle=grb) + qs = ConfigBundle.objects.filter(Q(hidden=False) & (Q(owner=user) | Q(public=True))).filter(bundle=grb) return qs def put_confirm_info(self, bundle): -- cgit 1.2.3-korg