diff --git a/sapl/base/models.py b/sapl/base/models.py index 9e8e59613..fb8829bbf 100644 --- a/sapl/base/models.py +++ b/sapl/base/models.py @@ -5,7 +5,6 @@ from django.utils.translation import ugettext_lazy as _ from sapl.utils import UF, YES_NO_CHOICES - TIPO_DOCUMENTO_ADMINISTRATIVO = (('O', _('Ostensivo')), ('R', _('Restritivo'))) diff --git a/sapl/base/urls.py b/sapl/base/urls.py index 196b7d36d..e44d8d438 100644 --- a/sapl/base/urls.py +++ b/sapl/base/urls.py @@ -4,9 +4,8 @@ from django.views.generic.base import TemplateView from .apps import AppConfig from .forms import LoginForm -from .views import (AppConfigCrud, - CasaLegislativaCrud, HelpView, RelatorioAtasView, - RelatorioHistoricoTramitacaoView, +from .views import (AppConfigCrud, CasaLegislativaCrud, HelpView, + RelatorioAtasView, RelatorioHistoricoTramitacaoView, RelatorioMateriasPorAnoAutorTipoView, RelatorioMateriasPorAutorView, RelatorioMateriasTramitacaoView, diff --git a/sapl/compilacao/forms.py b/sapl/compilacao/forms.py index 30ad5c63a..f93f71855 100644 --- a/sapl/compilacao/forms.py +++ b/sapl/compilacao/forms.py @@ -734,7 +734,9 @@ class DispositivoSearchModalForm(Form): placeholder=_('Digite palavras, letras, ' 'números ou algo' ' que estejam no texto.')), - StrictButton(_('Buscar'), css_class='btn-busca btn-primary')), 7)) + StrictButton( + _('Buscar'), + css_class='btn-busca btn-primary')), 7)) ) ) @@ -1135,7 +1137,7 @@ class DispositivoEdicaoAlteracaoForm(ModelForm): 'Dispositivo que sua data de início ' 'de vigência é superior a do dispositivo ' 'em edição.')) - + if dsq.inicio_vigencia <= self.instance.fim_vigencia: raise ValidationError(_('Não é permitido possuir um Dispositivo ' 'Subsequente que sua data de início ' @@ -1278,8 +1280,3 @@ class DispositivoRegistroAlteracaoForm(Form): super(DispositivoRegistroAlteracaoForm, self).__init__(*args, **kwargs) self.fields['dispositivo_alterado'].choices = [] - - def save(self): - super(DispositivoRegistroAlteracaoForm, self).save() - - data = self.cleaned_data diff --git a/sapl/compilacao/templatetags/compilacao_filters.py b/sapl/compilacao/templatetags/compilacao_filters.py index 4846e71be..d7929c559 100644 --- a/sapl/compilacao/templatetags/compilacao_filters.py +++ b/sapl/compilacao/templatetags/compilacao_filters.py @@ -7,7 +7,6 @@ from django.utils.translation import ugettext_lazy as _ from sapl.compilacao.models import Dispositivo - register = template.Library() diff --git a/sapl/compilacao/urls.py b/sapl/compilacao/urls.py index 1c6cc2e70..f9b0de9f4 100644 --- a/sapl/compilacao/urls.py +++ b/sapl/compilacao/urls.py @@ -109,7 +109,6 @@ urlpatterns_compilacao = [ url(r'^config/tipo-textoarticulado/(?P[0-9]+)/delete$', views.TipoTaDeleteView.as_view(), name='tipo_ta_delete'), - ] urlpatterns = [ @@ -125,6 +124,3 @@ urlpatterns = [ include(VeiculoPublicacaoCrud.get_urls())), ] - -"""url(r'^(?P[0-9]+)/text/(?P[0-9]+)/actions', - views.ActionsEditView.as_view(), name='dispositivo_actions'),""" \ No newline at end of file diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index 4be220cde..ec26d5996 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -1,6 +1,6 @@ +import sys from collections import OrderedDict from datetime import datetime, timedelta -import sys from braces.views import FormMessagesMixin from django import forms @@ -23,30 +23,28 @@ from django.views.generic.edit import (CreateView, DeleteView, FormView, UpdateView) from django.views.generic.list import ListView -from sapl.compilacao.forms import ( - DispositivoDefinidorVigenciaForm, - DispositivoEdicaoAlteracaoForm, - DispositivoEdicaoBasicaForm, - DispositivoEdicaoVigenciaForm, - DispositivoSearchModalForm, NotaForm, - PublicacaoForm, TaForm, TextNotificacoesForm, - TipoTaForm, VideForm, DispositivoRegistroAlteracaoForm) -from sapl.compilacao.models import ( - Dispositivo, Nota, - PerfilEstruturalTextoArticulado, Publicacao, - TextoArticulado, TipoDispositivo, TipoNota, - TipoPublicacao, TipoTextoArticulado, TipoVide, - VeiculoPublicacao, Vide) -from sapl.compilacao.utils import DISPOSITIVO_SELECT_RELATED,\ - DISPOSITIVO_SELECT_RELATED_EDIT +from sapl.compilacao.forms import (DispositivoDefinidorVigenciaForm, + DispositivoEdicaoAlteracaoForm, + DispositivoEdicaoBasicaForm, + DispositivoEdicaoVigenciaForm, + DispositivoRegistroAlteracaoForm, + DispositivoSearchModalForm, NotaForm, + PublicacaoForm, TaForm, + TextNotificacoesForm, TipoTaForm, VideForm) +from sapl.compilacao.models import (Dispositivo, Nota, + PerfilEstruturalTextoArticulado, + Publicacao, TextoArticulado, + TipoDispositivo, TipoNota, TipoPublicacao, + TipoTextoArticulado, TipoVide, + VeiculoPublicacao, Vide) +from sapl.compilacao.utils import (DISPOSITIVO_SELECT_RELATED, + DISPOSITIVO_SELECT_RELATED_EDIT) from sapl.crud.base import Crud, CrudListView, make_pagination - TipoNotaCrud = Crud.build(TipoNota, 'tipo_nota') TipoVideCrud = Crud.build(TipoVide, 'tipo_vide') TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao') VeiculoPublicacaoCrud = Crud.build(VeiculoPublicacao, 'veiculo_publicacao') -#^class(.)+\((.)*^(CompMix)(.)* class IntegracaoTaView(TemplateView): @@ -1134,7 +1132,7 @@ class ActionDragAndMoveDispositivoAlteradoMixin(ActionsCommonsMixin): dpt.save() bloco.ordenar_bloco_alteracao() - data = {} + return {} class ActionDeleteDispositivoMixin(ActionsCommonsMixin): @@ -1158,11 +1156,6 @@ class ActionDeleteDispositivoMixin(ActionsCommonsMixin): base_anterior = base.get_nivel_zero_anterior() data = self.get_json_for_refresh(base_anterior) - bases_atualizacao = Dispositivo.objects.order_by('ordem').filter( - ta_id=base.ta_id, - ordem__gt=base.ordem, - nivel__lt=base.nivel) - data['pai'] = [base.get_raiz().pk] if ta_base.id != int(self.kwargs['ta_id']): @@ -1727,8 +1720,9 @@ class ActionDispositivoCreateMixin(ActionsCommonsMixin): data = {'pk': dvt.pk, 'pai': [dvt.pk, ]} - self.set_message(data, 'success', _('Dispositivo de Vigência atualizado ' - 'com sucesso!!!')) + self.set_message(data, 'success', + _('Dispositivo de Vigência atualizado ' + 'com sucesso!!!')) return data except: @@ -2196,8 +2190,6 @@ class DispositivoDinamicEditView( def get_initial(self): initial = UpdateView.get_initial(self) - #perfil_pk = self.set_perfil_in_session(self.request) - if 'action' in self.request.GET: initial.update({'editor_type': self.request.GET['action']}) @@ -2854,7 +2846,7 @@ class DispositivoEdicaoAlteracaoView(CompMixin, FormMessagesMixin, UpdateView): try: with transaction.atomic(): return self.form_valid(form) - except Exception as e: + except: return self.form_invalid(form) else: return self.form_invalid(form) diff --git a/sapl/materia/admin.py b/sapl/materia/admin.py index eef5d7213..6f5968c1f 100644 --- a/sapl/materia/admin.py +++ b/sapl/materia/admin.py @@ -1,4 +1,5 @@ from django.contrib import admin + from sapl.materia.models import Proposicao from sapl.settings import DEBUG from sapl.utils import register_all_models_in_admin diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 2468d5186..ff1a849f4 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1351,7 +1351,6 @@ class PrimeiraTramitacaoEmLoteView(PermissionRequiredMixin, FilterView): else: data_fim_prazo = None - import ipdb; ipdb.set_trace() for materia_id in marcadas: Tramitacao.objects.create( materia_id=materia_id, diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index ae25eaa8e..be02f467b 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -14,9 +14,8 @@ from django.views.generic import CreateView, DetailView, FormView, ListView from django.views.generic.base import TemplateView from django_filters.views import FilterView -from sapl.base.models import AppConfig - import sapl.crud.base +from sapl.base.models import AppConfig from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, CrudDeleteView, CrudListView, CrudUpdateView, make_pagination)