setup: Don't perform is-package-manager-busy checks when not needed

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-01-14 12:52:30 -08:00 committed by James Valleroy
parent 915b8013d9
commit d1ead29251
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -184,7 +184,10 @@ class SetupView(TemplateView):
context['setup_state'] = setup_helper.get_state()
context['setup_current_operation'] = setup_helper.current_operation
context['package_manager_is_busy'] = package.is_package_manager_busy()
# Perform expensive operation only if needed
if not context['setup_current_operation']:
context['package_manager_is_busy'] = package.is_package_manager_busy()
return context
def dispatch(self, request, *args, **kwargs):