diff --git a/sapl/api/serializers.py b/sapl/api/serializers.py index 9853d8718..9219bf0e4 100644 --- a/sapl/api/serializers.py +++ b/sapl/api/serializers.py @@ -110,7 +110,6 @@ class SessaoPlenariaSerializer(serializers.ModelSerializer): def __init__(self, *args, **kwargs): super(SessaoPlenariaSerializer, self).__init__(args, kwargs) - casa = CasaLegislativa.objects.first() def get_pk_sessao(self, obj): return obj.pk diff --git a/sapl/api/views.py b/sapl/api/views.py index 2909d5a0a..9853e6af0 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -173,8 +173,6 @@ class AutoresProvaveisListView(ListAPIView): serializer_class = ChoiceSerializer def get_queryset(self): - queryset = ListAPIView.get_queryset(self) - params = {'content_type__isnull': False} tipo = '' diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index 142b7f46d..c0071cdd2 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -142,7 +142,6 @@ class IntegracaoTaView(TemplateView): implemente, ou passe `None` para as chaves que são fixas. """) - map_fields = self.map_fields ta_values = getattr(self, 'ta_values', {}) item = get_object_or_404(self.model, pk=kwargs['pk']) diff --git a/sapl/materia/apps.py b/sapl/materia/apps.py index ecc8d09de..3ac053d1b 100644 --- a/sapl/materia/apps.py +++ b/sapl/materia/apps.py @@ -6,6 +6,3 @@ class AppConfig(apps.AppConfig): name = 'sapl.materia' label = 'materia' verbose_name = _('Matéria') - - def ready(self): - from . import signals diff --git a/sapl/materia/signals.py b/sapl/materia/signals.py index e774b0191..b9afb6ee9 100644 --- a/sapl/materia/signals.py +++ b/sapl/materia/signals.py @@ -1,6 +1,4 @@ import django.dispatch -from django.db.models.signals import post_delete, post_save -from .models import DocumentoAcessorio, MateriaLegislativa tramitacao_signal = django.dispatch.Signal(providing_args=['post', 'request']) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 9182a220f..9e9b63e45 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1,4 +1,4 @@ -from datetime import date, datetime +from datetime import datetime from random import choice from string import ascii_letters, digits diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index fe2390a8c..4804849b9 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -10,7 +10,7 @@ from django.db.models import Max, Q from django.http import Http404, HttpResponse, JsonResponse from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ -from django.views.generic import CreateView, DetailView, ListView +from django.views.generic import CreateView, ListView from django.views.generic.base import TemplateView from django_filters.views import FilterView @@ -29,7 +29,7 @@ from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm, ProtocoloFilterSet, ProtocoloMateriaForm, TramitacaoAdmEditForm, TramitacaoAdmForm) from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo, - Protocolo, StatusTramitacaoAdministrativo, + StatusTramitacaoAdministrativo, TipoDocumentoAdministrativo, TramitacaoAdministrativo) TipoDocumentoAdministrativoCrud = CrudAux.build( @@ -470,7 +470,8 @@ class ProtocoloMateriaView(PermissionRequiredMixin, CreateView): autor_parlamentar = Autor.objects.filter( content_type=model_parlamentar, object_id__in=lista_parlamentares) - lista_comissoes = Comissao.objects.filter(Q(data_extincao__isnull=True) | Q( + lista_comissoes = Comissao.objects.filter(Q( + data_extincao__isnull=True) | Q( data_extincao__gt=date.today())).values_list('id', flat=True) model_comissao = ContentType.objects.get_for_model(Comissao) autor_comissoes = Autor.objects.filter( diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index e29a9ee5e..410f62ac7 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -728,8 +728,6 @@ class PresencaOrdemDiaView(FormMixin, PresencaMixin, DetailView): self.object = self.get_object() form = self.get_form() - pk = kwargs['pk'] - if form.is_valid(): # Pegar os presentes salvos no banco presentes_banco = PresencaOrdemDia.objects.filter(