From 245a8186afe565f353316c069cf20082f076ec9a Mon Sep 17 00:00:00 2001 From: "FinByz Tech Pvt. Ltd" Date: Wed, 6 Mar 2019 22:48:11 +0530 Subject: [PATCH] fix: Allowed guest to attach files to web forms (#7017) Created the fix for the issue [#6774](https://github.com/frappe/frappe/issues/6774), in which guest can attach files in web forms like job application. --- frappe/utils/file_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/utils/file_manager.py b/frappe/utils/file_manager.py index ffe337df0b..839c3e1b20 100644 --- a/frappe/utils/file_manager.py +++ b/frappe/utils/file_manager.py @@ -429,7 +429,7 @@ def get_random_filename(extn=None, content_type=None): return random_string(7) + (extn or "") -@frappe.whitelist() +@frappe.whitelist(allow_guest=True) def validate_filename(filename): from frappe.utils import now_datetime timestamp = now_datetime().strftime(" %Y-%m-%d %H:%M:%S") @@ -450,4 +450,4 @@ def add_attachments(doctype, name, attachments): f = save_url(attach.file_url, attach.file_name, doctype, name, "Home/Attachments", attach.is_private) files.append(f) - return files \ No newline at end of file + return files