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