Browse Source

Revert "fix #1827 (#2234)"

This reverts commit 4aa0e5c3b8.
pull/2255/head
Edward Ribeiro 6 years ago
parent
commit
0278634119
  1. 2
      requirements/dev-requirements.txt
  2. 23
      requirements/requirements.txt
  3. 8
      sapl/base/tests/teststub_urls.py
  4. 1
      sapl/comissoes/tests/test_comissoes.py
  5. 2
      sapl/materia/forms.py
  6. 2
      sapl/sessao/forms.py
  7. 18
      sapl/sessao/views.py
  8. 15
      sapl/settings.py
  9. 2
      sapl/test_urls.py
  10. 6
      sapl/urls.py

2
requirements/dev-requirements.txt

@ -2,7 +2,7 @@
autopep8==1.2.4
beautifulsoup4==4.6.0
django-debug-toolbar==1.8
django-debug-toolbar==1.5
ipdb==0.10.1
pdbpp==0.9.2
pip-review==0.4

23
requirements/requirements.txt

@ -1,21 +1,24 @@
dj-database-url==0.4.1
django-haystack==2.6.0
django>=1.10,<1.11
git+git://github.com/rubgombar1/django-admin-bootstrapped.git
django>=1.9,<1.10
# 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
django-bootstrap3==7.0.1
django-bower==5.2.0
django-bower==5.1.0
django-braces==1.9.0
django-compressor==2.0
django-crispy-forms==1.6.1
django-extensions==1.9.8
django-extra-views==0.11.0
django-crispy-forms==1.6.0
django-extensions==1.6.7
django-extra-views==0.8.0
django-filter==0.15.3
django-floppyforms==1.6.2
django-model-utils==3.1.1
django-sass-processor==0.5.8
django-model-utils==2.5
django-sass-processor==0.5.4
djangorestframework==3.4.0
git+git://github.com/jasperlittle/django-rest-framework-docs
easy-thumbnails==2.5
drfdocs==0.0.11
easy-thumbnails==2.3
django-image-cropping==1.1.0
git+git://github.com/interlegis/trml2pdf.git
libsass==0.11.1

8
sapl/base/tests/teststub_urls.py

@ -1,9 +1,11 @@
from django.conf.urls import url
from django.conf.urls import patterns, url
from django.views.generic.base import TemplateView
from sapl.urls import urlpatterns as original_patterns
ptrn = [url(r'^zzzz$',
ptrn = patterns('',
url(r'^zzzz$',
TemplateView.as_view(
template_name='index.html'), name='zzzz')]
template_name='index.html'), name='zzzz'))
urlpatterns = original_patterns + ptrn

1
sapl/comissoes/tests/test_comissoes.py

@ -74,7 +74,6 @@ 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

2
sapl/materia/forms.py

@ -1166,7 +1166,7 @@ class TipoProposicaoSelect(Select):
str(data_has_perfil),
force_text(option_label))
def render_options(self, selected_choices):
def render_options(self, choices, selected_choices):
# Normalize to strings.
selected_choices = set(force_text(v) for v in selected_choices)
output = []

2
sapl/sessao/forms.py

@ -422,7 +422,7 @@ class VotacaoForm(forms.Form):
class VotacaoNominalForm(forms.Form):
resultado_votacao = forms.ModelChoiceField(label='Resultado da Votação',
required=False,
required=True,
queryset=TipoResultadoVotacao.objects.all())

18
sapl/sessao/views.py

@ -1838,6 +1838,9 @@ 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
@ -1845,21 +1848,6 @@ 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]

15
sapl/settings.py

@ -116,7 +116,11 @@ HAYSTACK_CONNECTIONS = {
},
}
MIDDLEWARE = [
if DEBUG:
INSTALLED_APPS += ('debug_toolbar', 'rest_framework_docs',)
MIDDLEWARE_CLASSES = (
'reversion.middleware.RevisionMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
@ -127,13 +131,8 @@ MIDDLEWARE = [
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'speedinfo.middleware.ProfilerMiddleware',
]
if DEBUG:
INSTALLED_APPS += ('debug_toolbar', 'rest_framework_docs',)
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ]
INTERNAL_IPS = ('127.0.0.1')
# 'speedinfo.middleware.ProfilerMiddleware', # Bug na versão 1.9
)
CACHES = {
'default': {

2
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):
for perm in _get_all_permissions(klass._meta, ctype):
searched_perms.append((ctype, perm))
all_perms = set(Permission.objects.filter(

6
sapl/urls.py

@ -70,12 +70,6 @@ urlpatterns = [
# http://stackoverflow.com/questions/35510373/
if settings.DEBUG:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]
urlpatterns += static(settings.STATIC_URL,
document_root=settings.STATIC_ROOT)

Loading…
Cancel
Save