diff --git a/sapl/painel/views.py b/sapl/painel/views.py index 123b1c63e..854197b16 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -88,6 +88,9 @@ def votante_view(request, pk): if p.parlamentar.id == parlamentar.id: context.update({'presente': True}) break + else: + context.update({'error_message': + 'Nenhuma matéria com votação nominal aberta.'}) # Recupera o voto do parlamentar logado try: diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 4fbecaab7..a03d63c24 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -506,10 +506,9 @@ class Votante(models.Model): verbose_name=_('Data'), auto_now_add=True, max_length=30, null=True, blank=True) - class Meta: verbose_name = _('Usuário') - verbose_name = _('Usuários') + verbose_name_plural = _('Usuários') def __str__(self): return self.user.username diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 8a7bdd353..132b43fda 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -1518,7 +1518,13 @@ class VotacaoNominalEditView(SessaoPermissionMixin): ordem.votacao_aberta = False ordem.save() - trySessaoPe() + try: + votacao = VotoParlamentar.objects.filter( + votacao_id=registro.id) + for v in votacao: + v.delete() + except: + pass return self.form_valid(form) diff --git a/sapl/templates/crud/detail.html b/sapl/templates/crud/detail.html index f425ed791..89d8862aa 100644 --- a/sapl/templates/crud/detail.html +++ b/sapl/templates/crud/detail.html @@ -32,6 +32,9 @@ {% endif %} {% endblock sub_actions %} + {% block extra_actions %} + {% endblock extra_actions %} +