Преглед на файлове

Merge pull request #4837 from pratu16x7/hotfix

[fix] slideshow private images validation
version-14
Prateeksha Singh преди 7 години
committed by GitHub
родител
ревизия
2223671ca7
No known key found for this signature in database GPG ключ ID: 4AEE18F83AFDEB23
променени са 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:


Зареждане…
Отказ
Запис