Handle case where deltas is null (#7516)

This commit is contained in:
Oliver 2024-06-26 13:17:31 +10:00 committed by GitHub
parent e920165901
commit 6cd0727714
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1438,7 +1438,7 @@ class StockTrackingList(ListAPI):
# Run a first pass through the data to determine which related models we need to lookup
for item in data:
deltas = item['deltas']
deltas = item['deltas'] or {}
for key in delta_models.keys():
if key in deltas:
@ -1455,7 +1455,7 @@ class StockTrackingList(ListAPI):
# Now, update the data with the serialized data
for item in data:
deltas = item['deltas']
deltas = item['deltas'] or {}
if key in deltas:
item['deltas'][f'{key}_detail'] = related_data.get(