This commit is contained in:
C committed 2026-01-04 13:38:48 -08:00
1 parent 7296927cea
commit 48a8a5ce54
1 file changed
+16 -10
+16 -10
View File
@@ -271,20 +271,26 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
# Get current version for version control # Get current version for version control
current_version = fresh_item.get("version") current_version = fresh_item.get("version")
category_id = fresh_item.get("category_id")
print(f"[@DEBUG] Fresh item version: {current_version}") # batch_get doesn't return category_id, so use original item_data if available
print(f"[@DEBUG] Fresh variation version: {variation_version}") if item_data and item_data.get("category_id"):
print(f"[@DEBUG] Category ID from fresh_item: {category_id}") category_id = item_data.get("category_id")
print(f"[@DEBUG] Present at all locations: {present_at_all_locations}") print(f"[@DEBUG] Using category_id from item_data: {category_id}")
print(f"[@DEBUG] Present at locations: {present_at_location_ids}") else:
category_id = fresh_item.get("category_id") or LEGO_CAT_ID
# Ensure we have a category_id print(
if not category_id: f"[@DEBUG] Category ID from fresh_item: {fresh_item.get('category_id')}"
)
if not fresh_item.get("category_id"):
print( print(
f"[@WARNING] No category_id in fresh_item, using LEGO_CAT_ID: {LEGO_CAT_ID}" f"[@WARNING] No category_id in fresh_item, using LEGO_CAT_ID: {LEGO_CAT_ID}"
) )
category_id = LEGO_CAT_ID
print(f"[@DEBUG] Fresh item version: {current_version}")
print(f"[@DEBUG] Fresh variation version: {variation_version}")
print(f"[@DEBUG] Final category_id: {category_id}")
print(f"[@DEBUG] Present at all locations: {present_at_all_locations}")
print(f"[@DEBUG] Present at locations: {present_at_location_ids}")
# Build upsert body # Build upsert body
variation_obj = { variation_obj = {