BomList can be filtered by "allow_variants" flag

This commit is contained in:
Oliver Walters 2021-06-01 14:03:21 +10:00
parent 5c71f04360
commit 0bd0e57f16

View File

@ -821,6 +821,14 @@ class BomList(generics.ListCreateAPIView):
queryset = queryset.filter(inherited=inherited)
# Filter by "allow_variants"
variants = params.get("allow_variants", None)
if variants is not None:
variants = str2bool(variants)
queryset = queryset.filter(allow_variants=variants)
# Filter by part?
part = params.get('part', None)