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
if 'items[]' in params:
items = params.getlist('items[]', [])
elif 'item' in params:
items = [params.get('item', None)]
if type(items) not in [list, tuple]:
items = [items]
for key in ['item', 'item[]', 'items', 'items[]']:
if key in params:
items = params.getlist(key, [])
valid_ids = []
@ -258,13 +254,10 @@ class StockLocationLabelMixin:
params = self.request.query_params
if 'locations[]' in params:
locations = params.getlist('locations[]', [])
elif 'location' in params:
locations = [params.get('location', None)]
for key in ['location', 'location[]', 'locations', 'locations[]']:
if type(locations) not in [list, tuple]:
locations = [locations]
if key in params:
locations = params.getlist(key, [])
valid_ids = []

View File

@ -62,7 +62,10 @@ class StockItemReportMixin:
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 = []
@ -92,7 +95,12 @@ class BuildReportMixin:
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 = []
@ -119,7 +127,10 @@ class PartReportMixin:
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 = []