Be more robust against non-int values for level in app catalog (e.g. for apps 'inprogress' for which level is '?')

This commit is contained in:
Alexandre Aubin 2021-03-22 20:45:03 +01:00
parent 09d306924a
commit 33fab1c99f

View file

@ -257,8 +257,9 @@ def _app_upgradable(app_infos):
return "url_required" return "url_required"
# Do not advertise upgrades for bad-quality apps # Do not advertise upgrades for bad-quality apps
level = app_in_catalog.get("level", -1)
if ( if (
not app_in_catalog.get("level", -1) >= 5 not (isinstance(level, int) and level >= 5)
or app_in_catalog.get("state") != "working" or app_in_catalog.get("state") != "working"
): ):
return "bad_quality" return "bad_quality"