2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 18:15:40 +00:00

Bug fix for label / report filtering

This commit is contained in:
Oliver Walters
2021-02-23 15:40:31 +11:00
parent 94c8bb6805
commit 8c9202de21
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 = []