From 34214ad239fcc38cfbadd2552a109ade8c980dd8 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 9 Jun 2017 14:43:47 -0300 Subject: [PATCH] =?UTF-8?q?Otimiza=C3=A7=C3=A3o=20menor=20de=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/parlamentares/models.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 965761e34..90532935b 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -26,17 +26,10 @@ class Legislatura(models.Model): def atual(self): current_year = datetime.now().year - if(self.data_inicio.year <= current_year and - self.data_fim.year >= current_year): - return True - else: - return False + return self.data_inicio.year <= current_year <= self.data_fim.year def __str__(self): - if self.atual(): - current = ' (%s)' % _('Atual') - else: - current = '' + current = ' (%s)' % _('Atual') if self.atual() else '' return _('%(numero)sÂȘ (%(start)s - %(end)s)%(current)s') % { 'numero': self.numero,