refactor!: deprecate sorting based on apps.txt in get_installed_apps

This commit is contained in:
Sagar Vora 2022-08-18 11:40:29 +05:30 committed by Ankush Menat
parent bfaadfd32d
commit d8b7bc18d7
3 changed files with 9 additions and 5 deletions

View file

@ -1400,7 +1400,12 @@ def get_all_apps(with_internal_apps=True, sites_path=None):
@request_cache
def get_installed_apps(sort=False, frappe_last=False):
"""Get list of installed apps in current site."""
"""
Get list of installed apps in current site.
:param sort: [DEPRECATED] Sort installed apps based on the sequence in sites/apps.txt
"""
if getattr(flags, "in_install_db", True):
return []
@ -1445,7 +1450,7 @@ def _load_app_hooks(app_name: str | None = None):
import types
hooks = {}
apps = [app_name] if app_name else get_installed_apps(sort=True)
apps = [app_name] if app_name else get_installed_apps()
for app in apps:
try:

View file

@ -108,7 +108,7 @@ def get_versions():
}
}"""
versions = {}
for app in frappe.get_installed_apps(sort=True):
for app in frappe.get_installed_apps():
app_hooks = frappe.get_hooks(app_name=app)
versions[app] = {
"title": app_hooks.get("app_title")[0],

View file

@ -112,8 +112,7 @@ def get_jloader():
apps = frappe.get_hooks("template_apps")
if not apps:
apps = frappe.local.flags.web_pages_apps or frappe.get_installed_apps(sort=True)
apps.reverse()
apps = list(reversed(frappe.local.flags.web_pages_apps or frappe.get_installed_apps()))
if "frappe" not in apps:
apps.append("frappe")