fix: allow guests/users without desk access to upload text files (#16920)
* fix: allow guests/users without desk access to upload text files * chore: update error message Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com>
This commit is contained in:
parent
176518ed2c
commit
20d73cae24
1 changed files with 2 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ ALLOWED_MIMETYPES = (
|
|||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application/vnd.oasis.opendocument.text",
|
||||
"application/vnd.oasis.opendocument.spreadsheet",
|
||||
"text/plain",
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -202,7 +203,7 @@ def upload_file():
|
|||
if not file_url 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, or Microsoft documents."))
|
||||
frappe.throw(_("You can only upload JPG, PNG, PDF, TXT or Microsoft documents."))
|
||||
|
||||
if method:
|
||||
method = frappe.get_attr(method)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue