Merge pull request #28804 from RitvikSardana/csv-support

fix: add support for CSV files for non desk users
This commit is contained in:
Akhil Narang 2024-12-17 16:47:16 +05:30 committed by GitHub
commit b861a014ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,6 +36,7 @@ ALLOWED_MIMETYPES = (
"text/plain",
"video/quicktime",
"video/mp4",
"text/csv",
)
@ -180,7 +181,7 @@ def upload_file():
if content is not None and (frappe.session.user == "Guest" or (user and not user.has_desk_access())):
filetype = guess_type(filename)[0]
if filetype not in ALLOWED_MIMETYPES:
frappe.throw(_("You can only upload JPG, PNG, PDF, TXT or Microsoft documents."))
frappe.throw(_("You can only upload JPG, PNG, PDF, TXT, CSV or Microsoft documents."))
if method:
method = frappe.get_attr(method)