setup: Use apps instead of modules to determine running first setup

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2021-11-24 12:04:05 -08:00 committed by James Valleroy
parent 7eab8a2cda
commit b9dc2d38f6
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -240,12 +240,10 @@ def _get_apps_for_regular_setup():
def _set_is_first_setup():
"""Set whether all essential modules have been setup at least once."""
"""Set whether all essential apps have been setup at least once."""
global _is_first_setup
modules = plinth.module_loader.loaded_modules.values()
_is_first_setup = any(
(module for module in modules
if module.app.info.is_essential and module.app.needs_setup()))
_is_first_setup = any((app for app in app_module.App.list()
if app.info.is_essential and app.needs_setup()))
def run_setup_on_apps(app_ids, allow_install=True):