handle no numbers in set name
This commit is contained in:
1 parent
b4b0ccdac6
commit
a419dd498f
2 files changed
+7
-1
No files matched your search
@@ -24,3 +24,5 @@ doc/pw-inventory/SQUARE_inventory_forautomation_2025-06-18-0139.csv
|
|||||||
doc/pw-inventory/square_inventory_export_2025-06-18-0137.xlsx
|
doc/pw-inventory/square_inventory_export_2025-06-18-0137.xlsx
|
||||||
|
|
||||||
square-src.code-workspace
|
square-src.code-workspace
|
||||||
|
|
||||||
|
doc/pw-inventory/
|
||||||
+5
-1
@@ -103,7 +103,11 @@ async def acat2id(cat_id: str):
|
|||||||
{
|
{
|
||||||
"id": obj["id"],
|
"id": obj["id"],
|
||||||
"name": obj.get("item_data", {}).get("name", "Unknown"),
|
"name": obj.get("item_data", {}).get("name", "Unknown"),
|
||||||
"number": get_set_number(obj.get("item_data", {}).get("name", ""))
|
"number": None if not obj.get("item_data", {}).get("name", "") else (
|
||||||
|
get_set_number(obj.get("item_data", {}).get("name", ""))
|
||||||
|
if re.findall(r"\d{5}", obj.get("item_data", {}).get("name", ""))
|
||||||
|
else None
|
||||||
|
)
|
||||||
}
|
}
|
||||||
for obj in result_json.get("objects", [])
|
for obj in result_json.get("objects", [])
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in new issue
Block a user