From 28701e7951badd71713771bb0cafca303f4a7241 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Tue, 13 May 2025 15:41:50 +0530 Subject: [PATCH] fix(apps): don't skip app if no permission hook (#32492) Fixes 2077e90bf1a210c10f381d85350f0363b52553f2 Signed-off-by: Akhil Narang --- frappe/apps.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/frappe/apps.py b/frappe/apps.py index 48810504c5..a8476816a2 100644 --- a/frappe/apps.py +++ b/frappe/apps.py @@ -21,20 +21,20 @@ def get_apps(): if not len(app_details): continue for app_detail in app_details: - if has_permission_path := app_detail.get("has_permission"): - try: - if not frappe.get_attr(has_permission_path)(): - continue - app_list.append( - { - "name": app, - "logo": app_detail.get("logo"), - "title": _(app_detail.get("title")), - "route": app_detail.get("route"), - } - ) - except Exception: - frappe.log_error(f"Failed to call has_permission hook ({has_permission_path}) for {app}") + try: + has_permission_path = app_detail.get("has_permission") + if has_permission_path and not frappe.get_attr(has_permission_path)(): + continue + app_list.append( + { + "name": app, + "logo": app_detail.get("logo"), + "title": _(app_detail.get("title")), + "route": app_detail.get("route"), + } + ) + except Exception: + frappe.log_error(f"Failed to call has_permission hook ({has_permission_path}) for {app}") return app_list