Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2021-02-23 17:01:50 +11:00
commit dc9f7a7e82
2 changed files with 20 additions and 16 deletions

View File

@ -122,13 +122,9 @@ class StockItemLabelMixin:
params = self.request.query_params params = self.request.query_params
if 'items[]' in params: for key in ['item', 'item[]', 'items', 'items[]']:
items = params.getlist('items[]', []) if key in params:
elif 'item' in params: items = params.getlist(key, [])
items = [params.get('item', None)]
if type(items) not in [list, tuple]:
items = [items]
valid_ids = [] valid_ids = []
@ -258,13 +254,10 @@ class StockLocationLabelMixin:
params = self.request.query_params params = self.request.query_params
if 'locations[]' in params: for key in ['location', 'location[]', 'locations', 'locations[]']:
locations = params.getlist('locations[]', [])
elif 'location' in params:
locations = [params.get('location', None)]
if type(locations) not in [list, tuple]: if key in params:
locations = [locations] locations = params.getlist(key, [])
valid_ids = [] valid_ids = []

View File

@ -62,7 +62,10 @@ class StockItemReportMixin:
params = self.request.query_params params = self.request.query_params
items = params.getlist('item', []) for key in ['item', 'item[]', 'items', 'items[]']:
if key in params:
items = params.getlist(key, [])
break
valid_ids = [] valid_ids = []
@ -92,7 +95,12 @@ class BuildReportMixin:
params = self.request.query_params params = self.request.query_params
builds = params.getlist('build', []) for key in ['build', 'build[]', 'builds', 'builds[]']:
if key in params:
builds = params.getlist(key, [])
break
valid_ids = [] valid_ids = []
@ -119,7 +127,10 @@ class PartReportMixin:
params = self.request.query_params params = self.request.query_params
parts = params.getlist('part', []) for key in ['part', 'part[]', 'parts', 'parts[]']:
if key in params:
parts = params.getlist(key, [])
valid_ids = [] valid_ids = []