mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 03:55:41 +00:00
PEP fixes
This commit is contained in:
@ -9,8 +9,6 @@ from django.conf import settings
|
|||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from django.db.models import Sum, Count
|
|
||||||
|
|
||||||
from .models import StockLocation, StockItem
|
from .models import StockLocation, StockItem
|
||||||
from .models import StockItemTracking
|
from .models import StockItemTracking
|
||||||
|
|
||||||
@ -298,10 +296,13 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
|
|
||||||
loc_id = item['location']
|
loc_id = item['location']
|
||||||
|
|
||||||
if loc_id not in locations:
|
if loc_id:
|
||||||
locations[loc_id] = StockLocation.objects.get(pk=loc_id).pathstring
|
if loc_id not in locations:
|
||||||
|
locations[loc_id] = StockLocation.objects.get(pk=loc_id).pathstring
|
||||||
|
|
||||||
item['location__path'] = locations[loc_id]
|
item['location__path'] = locations[loc_id]
|
||||||
|
else:
|
||||||
|
item['location__path'] = None
|
||||||
|
|
||||||
return Response(data)
|
return Response(data)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user