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.
This commit is contained in:
FinByz Tech Pvt. Ltd 2019-03-06 22:48:11 +05:30 committed by Faris Ansari
parent 9df07891ff
commit 245a8186af

View file

@ -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
return files