From e2bb596b6f121380e246702a6b019350930721af Mon Sep 17 00:00:00 2001 From: Anthony Belhadj Date: Mon, 18 Sep 2023 12:11:13 +0200 Subject: [PATCH] Quota scope filter in RequestFilter --- service_catalog/filters/request_filter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service_catalog/filters/request_filter.py b/service_catalog/filters/request_filter.py index f4c08c606..0ab074eca 100644 --- a/service_catalog/filters/request_filter.py +++ b/service_catalog/filters/request_filter.py @@ -3,6 +3,7 @@ from django_filters import MultipleChoiceFilter from Squest.utils.squest_filter import SquestFilter +from profiles.models import Scope, AbstractScope from service_catalog.models import Request from service_catalog.models.operations import OperationType from service_catalog.models.request import RequestState @@ -19,6 +20,12 @@ class Meta: choices=[], widget=SelectMultiple(attrs={'data-live-search': "true"})) + instance__quota_scope = MultipleChoiceFilter( + label="Quota scope", + choices=AbstractScope.objects.filter(id__in=Scope.objects.values_list("id", flat=True)).values_list("id", + "name"), + widget=SelectMultiple(attrs={'data-live-search': "true"})) + operation__type = MultipleChoiceFilter( label="Type", choices=OperationType.choices,