From f18135b52b038872159dcf0c030d4ae483fff90f Mon Sep 17 00:00:00 2001 From: jiangying Date: Mon, 9 Jan 2023 15:33:59 +0800 Subject: [PATCH] chore: simplify frappe/permissions.py raise_exception condition assignment (#19518) * simplify frappe/permissions.py raise_exception --- frappe/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/permissions.py b/frappe/permissions.py index 3f53f12a33..af4d4178a3 100644 --- a/frappe/permissions.py +++ b/frappe/permissions.py @@ -48,7 +48,7 @@ def print_has_permission_check_logs(func): frappe.flags["has_permission_check_logs"] = [] result = func(*args, **kwargs) self_perm_check = True if not kwargs.get("user") else kwargs.get("user") == frappe.session.user - raise_exception = False if kwargs.get("raise_exception") is False else True + raise_exception = kwargs.get("raise_exception", True) # print only if access denied # and if user is checking his own permission