fix(permission): use .get to avoid key error (#7187)

Port of https://github.com/frappe/frappe/pull/7184
This commit is contained in:
Suraj Shetty 2019-04-01 18:22:17 +05:30 committed by Faris Ansari
parent f853313a5a
commit 1c8fd3169e

View file

@ -28,7 +28,7 @@ def print_has_permission_check_logs(func):
# print only if access denied
# and if user is checking his own permission
if not result and self_perm_check:
msgprint(('<br>').join(frappe.flags['has_permission_check_logs']))
msgprint(('<br>').join(frappe.flags.get('has_permission_check_logs')))
frappe.flags.pop('has_permission_check_logs', None)
return result
return inner