From e66822750e562bee751d08359d3005663ec23cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 14 Aug 2013 13:10:09 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20de=20bug=20no=20c=C3=A1lcu?= =?UTF-8?q?lo=20do=20n=C3=BAmero=20de=20parlamentares=20da=20casa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/models.py | 2 ++ 1 file changed, 2 insertions(+) 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