chore: simplify frappe/permissions.py raise_exception condition assignment (#19518)

* simplify frappe/permissions.py raise_exception
This commit is contained in:
jiangying 2023-01-09 15:33:59 +08:00 committed by GitHub
parent 82d18f0bf0
commit f18135b52b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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