fix(apps): don't skip app if no permission hook (#32492)
Fixes 2077e90bf1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
e0df5ee076
commit
28701e7951
1 changed files with 14 additions and 14 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue