From 0152d1a48f3dedfff6171bfdc8d9387f44e8b7a3 Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Wed, 4 Apr 2018 14:26:33 -0300 Subject: [PATCH 1/6] Fix #1827 --- requirements/requirements.txt | 2 +- sapl/base/tests/teststub_urls.py | 8 +++----- sapl/comissoes/tests/test_comissoes.py | 1 + sapl/materia/forms.py | 2 +- sapl/test_urls.py | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index fe2e139c8..fb6ab96b1 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,6 +1,6 @@ dj-database-url==0.4.1 django-haystack==2.6.0 -django>=1.9,<1.10 +django>=1.10,<1.11 # TODO O django-admin-bootstrapped 2.5.7 não inseriu a mudança que permite # a compatibilidade com Django 1.9+. A linha abaixo será mudada quando uma # nova versão do django-admin-bootstrapped for lançada diff --git a/sapl/base/tests/teststub_urls.py b/sapl/base/tests/teststub_urls.py index 9796768f2..8b66d6586 100644 --- a/sapl/base/tests/teststub_urls.py +++ b/sapl/base/tests/teststub_urls.py @@ -1,11 +1,9 @@ -from django.conf.urls import patterns, url +from django.conf.urls import url from django.views.generic.base import TemplateView from sapl.urls import urlpatterns as original_patterns -ptrn = patterns('', - url(r'^zzzz$', +ptrn = [url(r'^zzzz$', TemplateView.as_view( - template_name='index.html'), name='zzzz')) - + template_name='index.html'), name='zzzz')] urlpatterns = original_patterns + ptrn diff --git a/sapl/comissoes/tests/test_comissoes.py b/sapl/comissoes/tests/test_comissoes.py index fee303192..055214616 100644 --- a/sapl/comissoes/tests/test_comissoes.py +++ b/sapl/comissoes/tests/test_comissoes.py @@ -72,6 +72,7 @@ def test_incluir_comissao_submit(admin_client): 'nome': 'Comissão Teste', 'sigla': 'CT', 'data_criacao': '2016-03-22', + 'unidade_deliberativa': True, 'salvar': 'salvar'}, follow=True) assert response.status_code == 200 diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 3d455ea29..e75c6beb8 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -1106,7 +1106,7 @@ class TipoProposicaoSelect(Select): str(data_has_perfil), force_text(option_label)) - def render_options(self, choices, selected_choices): + def render_options(self, selected_choices): # Normalize to strings. selected_choices = set(force_text(v) for v in selected_choices) output = [] diff --git a/sapl/test_urls.py b/sapl/test_urls.py index 8423a98ed..5670f7bff 100644 --- a/sapl/test_urls.py +++ b/sapl/test_urls.py @@ -56,7 +56,7 @@ def create_perms_post_migrate(sapl_app_config): ctype = ContentType.objects.get_for_model(klass) ctypes.add(ctype) - for perm in _get_all_permissions(klass._meta, ctype): + for perm in _get_all_permissions(klass._meta): searched_perms.append((ctype, perm)) all_perms = set(Permission.objects.filter( From 4dabbb8fa270bdd4eed583be5263dc84afcc3732 Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Wed, 4 Apr 2018 14:48:59 -0300 Subject: [PATCH 2/6] Atualiza django bower --- requirements/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index fb6ab96b1..7b80570e2 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -6,7 +6,7 @@ django>=1.10,<1.11 # nova versão do django-admin-bootstrapped for lançada git+git://github.com/django-admin-bootstrapped/django-admin-bootstrapped.git django-bootstrap3==7.0.1 -django-bower==5.1.0 +django-bower==5.2.0 django-braces==1.9.0 django-compressor==2.0 django-crispy-forms==1.6.0 From 56d4f41906dcc703ef672b23e982fc7c2cd94326 Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Thu, 5 Apr 2018 09:31:25 -0300 Subject: [PATCH 3/6] =?UTF-8?q?Ajusta=20valida=C3=A7=C3=A3o=20de=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/forms.py | 2 +- sapl/sessao/views.py | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sapl/sessao/forms.py b/sapl/sessao/forms.py index 219e5b69b..3c1613d5d 100644 --- a/sapl/sessao/forms.py +++ b/sapl/sessao/forms.py @@ -317,7 +317,7 @@ class VotacaoForm(forms.Form): class VotacaoNominalForm(forms.Form): resultado_votacao = forms.ModelChoiceField(label='Resultado da Votação', - required=True, + required=False, queryset=TipoResultadoVotacao.objects.all()) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 889f0ab8c..bf001f8c3 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -1810,9 +1810,6 @@ class VotacaoNominalAbstract(SessaoPermissionMixin): except ObjectDoesNotExist: raise Http404() - if 'cancelar-votacao' in request.POST: - fechar_votacao_materia(materia_votacao) - return self.form_valid(form) if form.is_valid(): votos_sim = 0 @@ -1820,6 +1817,21 @@ class VotacaoNominalAbstract(SessaoPermissionMixin): abstencoes = 0 nao_votou = 0 + if 'cancelar-votacao' in request.POST: + fechar_votacao_materia(materia_votacao) + if self.ordem: + return HttpResponseRedirect(reverse( + 'sapl.sessao:ordemdia_list', kwargs={'pk': kwargs['pk']})) + else: + return HttpResponseRedirect(reverse( + 'sapl.sessao:expedientemateria_list', + kwargs={'pk': kwargs['pk']})) + else: + if form.cleaned_data['resultado_votacao'] == None: + form.add_error(None, 'Não é possível finalizar a votação sem ' + 'nenhum resultado da votação') + return self.form_invalid(form) + for votos in request.POST.getlist('voto_parlamentar'): v = votos.split(':') voto = v[0] From 29b9774f20adfc973de5ee590c64193a894461fb Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Fri, 20 Apr 2018 11:36:49 -0300 Subject: [PATCH 4/6] Fix #1902 --- requirements/dev-requirements.txt | 2 +- requirements/requirements.txt | 2 +- sapl/settings.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/requirements/dev-requirements.txt b/requirements/dev-requirements.txt index 49ded787e..dba8788b2 100644 --- a/requirements/dev-requirements.txt +++ b/requirements/dev-requirements.txt @@ -2,7 +2,7 @@ autopep8==1.2.4 beautifulsoup4==4.6.0 -django-debug-toolbar==1.5 +django-debug-toolbar==1.8 ipdb==0.10.1 pdbpp==0.9.2 pip-review==0.4 diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 7b80570e2..ff7b751d7 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -4,7 +4,7 @@ django>=1.10,<1.11 # TODO O django-admin-bootstrapped 2.5.7 não inseriu a mudança que permite # a compatibilidade com Django 1.9+. A linha abaixo será mudada quando uma # nova versão do django-admin-bootstrapped for lançada -git+git://github.com/django-admin-bootstrapped/django-admin-bootstrapped.git +git+git://github.com/rubgombar1/django-admin-bootstrapped.git django-bootstrap3==7.0.1 django-bower==5.2.0 django-braces==1.9.0 diff --git a/sapl/settings.py b/sapl/settings.py index 22377226b..2fa161e04 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -116,7 +116,7 @@ HAYSTACK_CONNECTIONS = { if DEBUG: INSTALLED_APPS += ('debug_toolbar', 'rest_framework_docs',) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = [ 'reversion.middleware.RevisionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', @@ -127,8 +127,9 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware', 'speedinfo.middleware.ProfilerMiddleware', -) +] CACHES = { 'default': { From 5d763594c2d3dbfbf9ce0a474a2a08e55531565a Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Fri, 20 Apr 2018 14:56:39 -0300 Subject: [PATCH 5/6] HOT-FIX --- requirements/requirements.txt | 3 --- sapl/settings.py | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index ff7b751d7..439be2a12 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,9 +1,6 @@ dj-database-url==0.4.1 django-haystack==2.6.0 django>=1.10,<1.11 -# TODO O django-admin-bootstrapped 2.5.7 não inseriu a mudança que permite -# a compatibilidade com Django 1.9+. A linha abaixo será mudada quando uma -# nova versão do django-admin-bootstrapped for lançada git+git://github.com/rubgombar1/django-admin-bootstrapped.git django-bootstrap3==7.0.1 django-bower==5.2.0 diff --git a/sapl/settings.py b/sapl/settings.py index 2fa161e04..38d241005 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -112,10 +112,6 @@ HAYSTACK_CONNECTIONS = { }, } - -if DEBUG: - INSTALLED_APPS += ('debug_toolbar', 'rest_framework_docs',) - MIDDLEWARE = [ 'reversion.middleware.RevisionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -127,9 +123,11 @@ MIDDLEWARE = [ 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', - 'debug_toolbar.middleware.DebugToolbarMiddleware', 'speedinfo.middleware.ProfilerMiddleware', ] +if DEBUG: + INSTALLED_APPS += ('debug_toolbar', 'rest_framework_docs',) + MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ] CACHES = { 'default': { From 208d54403143c100152e1596d377755177ea845b Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Wed, 25 Apr 2018 14:30:33 -0300 Subject: [PATCH 6/6] =?UTF-8?q?Atualiza=20depend=C3=AAncias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements/requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 439be2a12..f29467e63 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -6,16 +6,16 @@ django-bootstrap3==7.0.1 django-bower==5.2.0 django-braces==1.9.0 django-compressor==2.0 -django-crispy-forms==1.6.0 -django-extensions==1.6.7 -django-extra-views==0.8.0 +django-crispy-forms==1.6.1 +django-extensions==1.9.8 +django-extra-views==0.11.0 django-filter==0.15.3 django-floppyforms==1.6.2 -django-model-utils==2.5 -django-sass-processor==0.5.4 +django-model-utils==3.1.1 +django-sass-processor==0.5.8 djangorestframework==3.4.0 -drfdocs==0.0.11 -easy-thumbnails==2.3 +git+git://github.com/jasperlittle/django-rest-framework-docs +easy-thumbnails==2.5 django-image-cropping==1.1.0 git+git://github.com/interlegis/trml2pdf.git libsass==0.11.1