Browse Source

Remove as chamadas a super informando classe (#2857)

pull/2761/head
Edward 6 years ago
committed by Cesar Carvalho
parent
commit
023a913785
  1. 39
      sapl/sessao/views.py

39
sapl/sessao/views.py

@ -579,7 +579,7 @@ class ExpedienteMateriaCrud(MasterDetailCrud):
form_class = ExpedienteMateriaForm form_class = ExpedienteMateriaForm
def get_initial(self): def get_initial(self):
initial = super(CreateView, self).get_initial() initial = super().get_initial()
initial['data_ordem'] = SessaoPlenaria.objects.get( initial['data_ordem'] = SessaoPlenaria.objects.get(
pk=self.kwargs['pk']).data_inicio.strftime('%d/%m/%Y') pk=self.kwargs['pk']).data_inicio.strftime('%d/%m/%Y')
max_numero_ordem = ExpedienteMateria.objects.filter( max_numero_ordem = ExpedienteMateria.objects.filter(
@ -642,7 +642,7 @@ class UpdateView(MasterDetailCrud.UpdateView):
form_class = OradorForm form_class = OradorForm
def get_initial(self): def get_initial(self):
initial = super(UpdateView, self).get_initial() initial = super().get_initial()
initial.update({'id_sessao': self.object.sessao_plenaria.id}) initial.update({'id_sessao': self.object.sessao_plenaria.id})
initial.update({'numero': self.object.numero_ordem}) initial.update({'numero': self.object.numero_ordem})
@ -678,7 +678,7 @@ class OradorExpedienteCrud(OradorCrud):
form_class = OradorForm form_class = OradorForm
def get_initial(self): def get_initial(self):
initial = super(UpdateView, self).get_initial() initial = super().get_initial()
initial.update({'id_sessao': self.object.sessao_plenaria.id}) initial.update({'id_sessao': self.object.sessao_plenaria.id})
initial.update({'numero':self.object.numero_ordem}) initial.update({'numero':self.object.numero_ordem})
@ -802,7 +802,7 @@ class OradorOrdemDiaCrud(OradorCrud):
form_class = OradorOrdemDiaForm form_class = OradorOrdemDiaForm
def get_initial(self): def get_initial(self):
initial = super(UpdateView, self).get_initial() initial = super().get_initial()
initial.update({'id_sessao': self.object.sessao_plenaria.id}) initial.update({'id_sessao': self.object.sessao_plenaria.id})
initial.update({'numero': self.object.numero_ordem}) initial.update({'numero': self.object.numero_ordem})
@ -2867,8 +2867,7 @@ class VotacaoNominalTransparenciaDetailView(TemplateView):
template_name = 'sessao/votacao/nominal_transparencia.html' template_name = 'sessao/votacao/nominal_transparencia.html'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(VotacaoNominalTransparenciaDetailView, context = super().get_context_data(**kwargs)
self).get_context_data(**kwargs)
materia_votacao = self.request.GET.get('materia', None) materia_votacao = self.request.GET.get('materia', None)
@ -2952,8 +2951,7 @@ class VotacaoSimbolicaTransparenciaDetailView(TemplateView):
template_name = 'sessao/votacao/simbolica_transparencia.html' template_name = 'sessao/votacao/simbolica_transparencia.html'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(VotacaoSimbolicaTransparenciaDetailView, context = super().get_context_data(**kwargs)
self).get_context_data(**kwargs)
materia_votacao = self.request.GET.get('materia', None) materia_votacao = self.request.GET.get('materia', None)
@ -3220,7 +3218,7 @@ class SessaoListView(ListView):
return SessaoPlenaria.objects.all().order_by('-data_inicio') return SessaoPlenaria.objects.all().order_by('-data_inicio')
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(SessaoListView, self).get_context_data(**kwargs) context = super().get_context_data(**kwargs)
paginator = context['paginator'] paginator = context['paginator']
page_obj = context['page_obj'] page_obj = context['page_obj']
@ -3384,8 +3382,7 @@ class PesquisarSessaoPlenariaView(FilterView):
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def get_filterset_kwargs(self, filterset_class): def get_filterset_kwargs(self, filterset_class):
super(PesquisarSessaoPlenariaView, super().get_filterset_kwargs(filterset_class)
self).get_filterset_kwargs(filterset_class)
kwargs = {'data': self.request.GET or None} kwargs = {'data': self.request.GET or None}
@ -3401,8 +3398,7 @@ class PesquisarSessaoPlenariaView(FilterView):
return kwargs return kwargs
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(PesquisarSessaoPlenariaView, context = super().get_context_data(**kwargs)
self).get_context_data(**kwargs)
context['title'] = _('Pesquisar Sessão Plenária') context['title'] = _('Pesquisar Sessão Plenária')
paginator = context['paginator'] paginator = context['paginator']
@ -3414,7 +3410,7 @@ class PesquisarSessaoPlenariaView(FilterView):
return context return context
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
super(PesquisarSessaoPlenariaView, self).get(request) super().get(request)
# Se a pesquisa estiver quebrando com a paginação # Se a pesquisa estiver quebrando com a paginação
# Olhe esta função abaixo # Olhe esta função abaixo
@ -3452,8 +3448,7 @@ class PesquisarPautaSessaoView(PesquisarSessaoPlenariaView):
logger.debug('Pesquisa de PautaSessao.') logger.debug('Pesquisa de PautaSessao.')
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(PesquisarPautaSessaoView, context = super().get_context_data(**kwargs)
self).get_context_data(**kwargs)
context['title'] = _('Pesquisar Pauta de Sessão') context['title'] = _('Pesquisar Pauta de Sessão')
return context return context
@ -3474,8 +3469,7 @@ class AdicionarVariasMateriasExpediente(PermissionRequiredForAppCrudMixin,
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def get_filterset_kwargs(self, filterset_class): def get_filterset_kwargs(self, filterset_class):
super(AdicionarVariasMateriasExpediente, super().get_filterset_kwargs(filterset_class)
self).get_filterset_kwargs(filterset_class)
kwargs = {'data': self.request.GET or None} kwargs = {'data': self.request.GET or None}
@ -3499,8 +3493,7 @@ class AdicionarVariasMateriasExpediente(PermissionRequiredForAppCrudMixin,
return kwargs return kwargs
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(MateriaLegislativaPesquisaView, context = super().get_context_data(**kwargs)
self).get_context_data(**kwargs)
context['title'] = _('Pesquisar Matéria Legislativa') context['title'] = _('Pesquisar Matéria Legislativa')
context['root_pk'] = self.kwargs['pk'] context['root_pk'] = self.kwargs['pk']
@ -3567,8 +3560,7 @@ class AdicionarVariasMateriasOrdemDia(AdicionarVariasMateriasExpediente):
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def get_filterset_kwargs(self, filterset_class): def get_filterset_kwargs(self, filterset_class):
super(AdicionarVariasMateriasExpediente, super().get_filterset_kwargs(filterset_class)
self).get_filterset_kwargs(filterset_class)
kwargs = {'data': self.request.GET or None} kwargs = {'data': self.request.GET or None}
@ -3786,8 +3778,7 @@ class VotacaoEmBlocoExpediente(PermissionRequiredForAppCrudMixin, ListView):
retiradapauta=None) retiradapauta=None)
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(VotacaoEmBlocoExpediente, context = super().get_context_data(**kwargs)
self).get_context_data(**kwargs)
context['pk'] = self.kwargs['pk'] context['pk'] = self.kwargs['pk']
context['root_pk'] = self.kwargs['pk'] context['root_pk'] = self.kwargs['pk']
if not verifica_sessao_iniciada(self.request, self.kwargs['pk']): if not verifica_sessao_iniciada(self.request, self.kwargs['pk']):

Loading…
Cancel
Save