Plando Items: Fix count with empty locations/location #5040

This commit is contained in:
Exempt-Medic
2025-06-02 12:01:21 -04:00
committed by GitHub
parent 0c5cb17d96
commit 99142fd662

View File

@@ -1524,9 +1524,11 @@ class PlandoItems(Option[typing.List[PlandoItem]]):
f"dictionary, not {type(items)}")
locations = item.get("locations", [])
if not locations:
locations = item.get("location", ["Everywhere"])
locations = item.get("location", [])
if locations:
count = 1
else:
locations = ["Everywhere"]
if isinstance(locations, str):
locations = [locations]
if not isinstance(locations, list):