fix(Website): throw error only if images are attached
This commit is contained in:
parent
08c75ab2e8
commit
faeeecb1a6
1 changed files with 1 additions and 1 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue