diff --git a/sapl/base/views.py b/sapl/base/views.py index 4b8c91305..e04c9e0af 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -3,8 +3,8 @@ from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.views.generic.base import TemplateView -from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, CrudUpdateView, - CrudDetailView) +from sapl.crud.base import Crud, CrudBaseMixin, CrudCreateView,\ + CrudDetailView, CrudUpdateView from sapl.utils import permissao_tb_aux from .forms import CasaLegislativaForm @@ -45,7 +45,7 @@ class CasaLegislativaCrud(Crud): kwargs={'pk': self.kwargs['pk']})) -class HelpView(TemplateView): +class HelpView(PermissionRequiredMixin, TemplateView): # XXX treat non existing template as a 404!!!! def get_template_names(self): diff --git a/sapl/parlamentares/migrations/0022_auto_20160702_1519.py b/sapl/parlamentares/migrations/0022_auto_20160702_1519.py new file mode 100644 index 000000000..6573268e1 --- /dev/null +++ b/sapl/parlamentares/migrations/0022_auto_20160702_1519.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.5 on 2016-07-02 18:19 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0021_merge'), + ] + + operations = [ + migrations.AlterField( + model_name='sessaolegislativa', + name='legislatura', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Legislatura', verbose_name='Legislatura'), + ), + ] diff --git a/scripts/inicializa_grupos_autorizacoes.py b/scripts/inicializa_grupos_autorizacoes.py index 1a8c2f7be..6ce8e9be8 100644 --- a/scripts/inicializa_grupos_autorizacoes.py +++ b/scripts/inicializa_grupos_autorizacoes.py @@ -141,38 +141,47 @@ def cria_grupos_permissoes(): # Cria usuarios op_geral_user = User.objects.get_or_create(username='op_geral')[0] op_geral_user.set_password('interlegis') + op_geral_user.save() op_geral.user_set.add(op_geral_user) op_materia_user = User.objects.get_or_create(username='op_materia')[0] op_materia_user.set_password('interlegis') + op_materia_user.save() op_materia.user_set.add(op_materia_user) op_prot_user = User.objects.get_or_create(username='op_protocolo')[0] op_prot_user.set_password('interlegis') + op_prot_user.save() op_prot.user_set.add(op_prot_user) op_sessao_user = User.objects.get_or_create(username='op_sessao')[0] op_sessao_user.set_password('interlegis') + op_sessao_user.save() op_sessao.user_set.add(op_sessao_user) op_comissao_user = User.objects.get_or_create(username='op_comissao')[0] op_comissao_user.set_password('interlegis') + op_comissao_user.save() op_comissao.user_set.add(op_comissao_user) op_adm_user = User.objects.get_or_create(username='op_adm')[0] op_adm_user.set_password('interlegis') + op_adm_user.save() op_adm.user_set.add(op_adm_user) op_norma_user = User.objects.get_or_create(username='op_norma')[0] op_norma_user.set_password('interlegis') + op_norma_user.save() op_norma.user_set.add(op_norma_user) op_painel_user = User.objects.get_or_create(username='op_painel')[0] op_painel_user.set_password('interlegis') + op_painel_user.save() op_painel.user_set.add(op_norma_user) op_autor_user = User.objects.get_or_create(username='op_autor')[0] op_autor_user.set_password('interlegis') + op_autor_user.save() op_autor.user_set.add(op_autor_user) if __name__ == '__main__':