fix yunohost app search fail

This commit is contained in:
cyxae 2021-07-13 19:35:20 +02:00 committed by ljf (zamentur)
parent fab248ce8c
commit 8cf9257683

View file

@ -127,14 +127,15 @@ def app_search(string):
catalog_of_apps = app_catalog() catalog_of_apps = app_catalog()
# Selecting apps according to a match in app name or description # Selecting apps according to a match in app name or description
matching_apps = {"apps": {}}
for app in catalog_of_apps["apps"].items(): for app in catalog_of_apps["apps"].items():
if not ( if (
re.search(string, app[0], flags=re.IGNORECASE) re.search(string, app[0], flags=re.IGNORECASE)
or re.search(string, app[1]["description"], flags=re.IGNORECASE) or re.search(string, app[1]["description"], flags=re.IGNORECASE)
): ):
del catalog_of_apps["apps"][app[0]] matching_apps["apps"][app[0]] = app[1]
return catalog_of_apps return matching_apps
# Old legacy function... # Old legacy function...