mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
fix: for list of images, remove empty strings (#2634)
* For list of images, remove empty strings * Fix formatting --------- Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
parent
f72fcc3031
commit
cb1769a352
@ -102,7 +102,7 @@ def clean_image(image: str | list | dict | None = None, default: str = "no image
|
|||||||
case str(image):
|
case str(image):
|
||||||
return [image]
|
return [image]
|
||||||
case [str(_), *_]:
|
case [str(_), *_]:
|
||||||
return image
|
return [x for x in image if x] # Only return non-null strings in list
|
||||||
case [{"url": str(_)}, *_]:
|
case [{"url": str(_)}, *_]:
|
||||||
return [x["url"] for x in image]
|
return [x["url"] for x in image]
|
||||||
case {"url": str(image)}:
|
case {"url": str(image)}:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user