소스 검색

[fix] slideshow private images validation

version-14
Prateeksha Singh 7 년 전
부모
커밋
3995fd8582
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. +4
    -3
      frappe/website/doctype/website_slideshow/website_slideshow.py

+ 4
- 3
frappe/website/doctype/website_slideshow/website_slideshow.py 파일 보기

@@ -21,9 +21,10 @@ 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)
result = frappe.get_all("File", filters={ "file_url":("in", files) }, fields="is_private")
if any([file.is_private for file in result]):
frappe.throw(_("All Images attached to Website Slideshow should be public"))
if files:
result = frappe.get_all("File", filters={ "file_url":("in", files) }, fields="is_private")
if any([file.is_private for file in result]):
frappe.throw(_("All Images attached to Website Slideshow should be public"))

def get_slideshow(doc):
if not doc.slideshow:


불러오는 중...
취소
저장