From a0bc49fbbf8e502dc9906f7f52d4d7aba19e55d1 Mon Sep 17 00:00:00 2001 From: Edward Oliveira Date: Thu, 25 Aug 2022 21:58:13 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20conserta=20listagem=20unid.=20tramit?= =?UTF-8?q?a=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/materia/views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index d0cdc07c3..d02959e83 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -793,14 +793,20 @@ class UnidadeTramitacaoCrud(CrudAux): def get_headers(self): return [_('Unidade de Tramitação')] + def is_not_empty(self, value): + if value is None: + return False + value = value.strip().replace(' ', '') + return value != '' + def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) for row in context['rows']: - if row[0][0]: # Comissão + if self.is_not_empty(row[0][0]): # Comissão pass - elif row[1][0]: # Órgão + elif self.is_not_empty(row[1][0]): # Órgão row[0] = (row[1][0], row[0][1]) - elif row[2][0]: # Parlamentar + elif self.is_not_empty(row[2][0]): # Parlamentar row[0] = (row[2][0], row[0][1]) row[1], row[2] = ('', ''), ('', '') return context