recompute percent completion if needed on load of city stats

This commit is contained in:
Tykayn 2025-08-12 11:42:23 +02:00 committed by tykayn
parent b959c695ae
commit 46f8b3f6ab

View file

@ -302,6 +302,12 @@ final class AdminController extends AbstractController
$this->addFlash('error', '1 Aucune stats trouvée pour ce code INSEE. Veuillez d\'abord ajouter la ville.');
return $this->redirectToRoute('app_admin_import_stats');
}
$completion = $stats->getCompletionPercent();
if (!$completion) {
$stats->computeCompletionPercent();
$completion = $stats->getCompletionPercent();
}
$followups = $stats->getCityFollowUps();
$refresh = false;
if (!$followups->isEmpty()) {