diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 71ef475..ec012d0 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -84,6 +84,8 @@ class CasaLegislativa(models.Model): @property def num_parlamentares(self): + if not self.legislatura_set.exists(): + return 0 return self.legislatura_set.latest('data_inicio').total_parlamentares @property