fix(Website): throw error only if images are attached (#34725)

This commit is contained in:
Ejaaz Khan 2025-11-17 16:37:37 +05:30 committed by GitHub
commit 6225755971
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,7 @@ class WebsiteSlideshow(Document):
def validate_images(self):
"""atleast one image file should be public for slideshow"""
files = map(lambda row: row.image, self.slideshow_items)
if files:
if files and self.slideshow_items:
result = frappe.get_all("File", filters={"file_url": ("in", list(files))}, fields="is_private")
if any(file.is_private for file in result):
frappe.throw(_("All Images attached to Website Slideshow should be public"))