diff --git a/compilacao/views.py b/compilacao/views.py index a6298330b..78aaa5fed 100644 --- a/compilacao/views.py +++ b/compilacao/views.py @@ -105,6 +105,9 @@ class CompilacaoView(ListView): else: self.itens_de_vigencia[9999] = [item, ] + if len(self.itens_de_vigencia.keys()) <= 1: + return{} + self.itens_de_vigencia = OrderedDict( sorted(self.itens_de_vigencia.items(), key=lambda t: t[0])) diff --git a/templates/compilacao/index.html b/templates/compilacao/index.html index d0041c8c0..f5d059fd2 100644 --- a/templates/compilacao/index.html +++ b/templates/compilacao/index.html @@ -23,20 +23,17 @@ {% endfor %} {% elif forloop.last %} {% for dispositivo in values %} - {% trans 'Texto em Vigência'%} + {% trans 'Texto em Vigência'%} {% endfor %} {% else %} {{ key }} {%endif%} - {% if not forloop.first and not forloop.last %} - + {% if not forloop.first and not forloop.last %}