NO LOCATION AAAAH

This commit is contained in:
C committed 2026-01-04 13:34:51 -08:00
1 parent 0f68b09a00
commit a2746737ce
2 files changed
+13 -10

No files matched your search

+2 -10
View File
@@ -306,12 +306,12 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
if variation_version is not None:
variation_obj["version"] = variation_version
# Build item object matching variation's location settings
# Build item object - DO NOT modify location settings
# Square will preserve existing present_at_all_locations configuration
item_obj = {
"type": "ITEM",
"id": item_id,
"version": current_version,
"present_at_all_locations": present_at_all_locations,
"item_data": {
"name": pw_name,
"description": f"{set_name} - {set_theme}",
@@ -319,14 +319,6 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
"variations": [variation_obj],
},
}
# Only include present_at_location_ids if not at all locations
if not present_at_all_locations and present_at_location_ids:
item_obj["present_at_location_ids"] = present_at_location_ids
upsert_body = {
"idempotency_key": str(uuid.uuid4()),
"object": item_obj,
}
# Remove None values