From 2d749379c1bee0ef433d53ab803203bc226ef9c8 Mon Sep 17 00:00:00 2001 From: Ulysses Lara Date: Fri, 12 Jun 2020 13:06:10 -0300 Subject: [PATCH] Fix #3191 - Corrigindo erro em comissao (#3192) --- sapl/comissoes/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/comissoes/forms.py b/sapl/comissoes/forms.py index 5aadad6b4..77523d26b 100644 --- a/sapl/comissoes/forms.py +++ b/sapl/comissoes/forms.py @@ -10,6 +10,7 @@ from django.db import transaction from django.db.models import Q from django.forms import ModelForm from django.utils.translation import ugettext_lazy as _ +from django.utils import timezone from sapl.base.models import Autor, TipoAutor from sapl.comissoes.models import (Comissao, Composicao, @@ -142,7 +143,6 @@ class ParticipacaoCreateForm(forms.ModelForm): values_list('parlamentar', flat=True ).distinct() - qs = Parlamentar.objects.filter(id__in=parlamentares).distinct().\ exclude(id__in=id_part) eligible = self.verifica() @@ -184,7 +184,7 @@ class ParticipacaoCreateForm(forms.ModelForm): def create_participacao(self): composicao = Composicao.objects.get(id=self.initial['parent_pk']) data_inicio_comissao = composicao.periodo.data_inicio - data_fim_comissao = composicao.periodo.data_fim + data_fim_comissao = composicao.periodo.data_fim if composicao.periodo.data_fim else timezone.now() q1 = Q(data_fim_mandato__isnull=False, data_fim_mandato__gte=data_inicio_comissao) q2 = Q(data_inicio_mandato__gte=data_inicio_comissao) \