From e8623dbc19c7eab3598d0e5f9bd5bd9e30a2e8ff Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Mon, 11 Jul 2022 14:10:59 +0530 Subject: [PATCH] fix: simplify condition --- frappe/handler.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frappe/handler.py b/frappe/handler.py index d74125a9e0..b1bbb6bf10 100644 --- a/frappe/handler.py +++ b/frappe/handler.py @@ -206,9 +206,7 @@ def upload_file(): frappe.local.uploaded_file = content 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] if filetype not in ALLOWED_MIMETYPES: frappe.throw(_("You can only upload JPG, PNG, PDF, TXT or Microsoft documents."))