2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 13:10:57 +00:00

Fixed test cases?

This commit is contained in:
eeintech
2021-01-12 15:02:44 -05:00
parent 452d22579a
commit 49c954aa68
3 changed files with 44 additions and 31 deletions

View File

@ -181,15 +181,13 @@ class StockLocationEdit(AjaxUpdateView):
# Update stock items
stock_items = self.object.get_stock_items()
print(f'{stock_items=}')
for stock_item in stock_items:
# Check if current owner is subset of new owner
if stock_item.owner and authorized_owners:
if stock_item.owner in authorized_owners:
print(f'{stock_item.owner} is authorized')
continue
print(f'Updating stock item {stock_item} owner')
stock_item.owner = self.object.owner
stock_item.save()