Преглед изворни кода

fix: simplify condition

version-14
Sagar Vora пре 2 година
родитељ
комит
e8623dbc19
1 измењених фајлова са 1 додато и 3 уклоњено
  1. +1
    -3
      frappe/handler.py

+ 1
- 3
frappe/handler.py Прегледај датотеку

@@ -206,9 +206,7 @@ def upload_file():
frappe.local.uploaded_file = content frappe.local.uploaded_file = content
frappe.local.uploaded_filename = filename frappe.local.uploaded_filename = filename


if (not file_url or content) and (
frappe.session.user == "Guest" or (user and not user.has_desk_access())
):
if content and (frappe.session.user == "Guest" or (user and not user.has_desk_access())):
filetype = guess_type(filename)[0] filetype = guess_type(filename)[0]
if filetype not in ALLOWED_MIMETYPES: 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 or Microsoft documents."))


Loading…
Откажи
Сачувај