Browse Source

Merge branch '103-autorizacaov2' into 474-criar-secao-doc-adm-v2

pull/506/head
Eduardo Calil 9 years ago
parent
commit
af5b7053c1
  1. 6
      sapl/base/views.py
  2. 21
      sapl/parlamentares/migrations/0022_auto_20160702_1519.py
  3. 9
      scripts/inicializa_grupos_autorizacoes.py

6
sapl/base/views.py

@ -3,8 +3,8 @@ from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, CrudUpdateView, from sapl.crud.base import Crud, CrudBaseMixin, CrudCreateView,\
CrudDetailView) CrudDetailView, CrudUpdateView
from sapl.utils import permissao_tb_aux from sapl.utils import permissao_tb_aux
from .forms import CasaLegislativaForm from .forms import CasaLegislativaForm
@ -45,7 +45,7 @@ class CasaLegislativaCrud(Crud):
kwargs={'pk': self.kwargs['pk']})) kwargs={'pk': self.kwargs['pk']}))
class HelpView(TemplateView): class HelpView(PermissionRequiredMixin, TemplateView):
# XXX treat non existing template as a 404!!!! # XXX treat non existing template as a 404!!!!
def get_template_names(self): def get_template_names(self):

21
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'),
),
]

9
scripts/inicializa_grupos_autorizacoes.py

@ -141,38 +141,47 @@ def cria_grupos_permissoes():
# Cria usuarios # Cria usuarios
op_geral_user = User.objects.get_or_create(username='op_geral')[0] op_geral_user = User.objects.get_or_create(username='op_geral')[0]
op_geral_user.set_password('interlegis') op_geral_user.set_password('interlegis')
op_geral_user.save()
op_geral.user_set.add(op_geral_user) op_geral.user_set.add(op_geral_user)
op_materia_user = User.objects.get_or_create(username='op_materia')[0] op_materia_user = User.objects.get_or_create(username='op_materia')[0]
op_materia_user.set_password('interlegis') op_materia_user.set_password('interlegis')
op_materia_user.save()
op_materia.user_set.add(op_materia_user) op_materia.user_set.add(op_materia_user)
op_prot_user = User.objects.get_or_create(username='op_protocolo')[0] op_prot_user = User.objects.get_or_create(username='op_protocolo')[0]
op_prot_user.set_password('interlegis') op_prot_user.set_password('interlegis')
op_prot_user.save()
op_prot.user_set.add(op_prot_user) op_prot.user_set.add(op_prot_user)
op_sessao_user = User.objects.get_or_create(username='op_sessao')[0] op_sessao_user = User.objects.get_or_create(username='op_sessao')[0]
op_sessao_user.set_password('interlegis') op_sessao_user.set_password('interlegis')
op_sessao_user.save()
op_sessao.user_set.add(op_sessao_user) op_sessao.user_set.add(op_sessao_user)
op_comissao_user = User.objects.get_or_create(username='op_comissao')[0] op_comissao_user = User.objects.get_or_create(username='op_comissao')[0]
op_comissao_user.set_password('interlegis') op_comissao_user.set_password('interlegis')
op_comissao_user.save()
op_comissao.user_set.add(op_comissao_user) op_comissao.user_set.add(op_comissao_user)
op_adm_user = User.objects.get_or_create(username='op_adm')[0] op_adm_user = User.objects.get_or_create(username='op_adm')[0]
op_adm_user.set_password('interlegis') op_adm_user.set_password('interlegis')
op_adm_user.save()
op_adm.user_set.add(op_adm_user) op_adm.user_set.add(op_adm_user)
op_norma_user = User.objects.get_or_create(username='op_norma')[0] op_norma_user = User.objects.get_or_create(username='op_norma')[0]
op_norma_user.set_password('interlegis') op_norma_user.set_password('interlegis')
op_norma_user.save()
op_norma.user_set.add(op_norma_user) op_norma.user_set.add(op_norma_user)
op_painel_user = User.objects.get_or_create(username='op_painel')[0] op_painel_user = User.objects.get_or_create(username='op_painel')[0]
op_painel_user.set_password('interlegis') op_painel_user.set_password('interlegis')
op_painel_user.save()
op_painel.user_set.add(op_norma_user) op_painel.user_set.add(op_norma_user)
op_autor_user = User.objects.get_or_create(username='op_autor')[0] op_autor_user = User.objects.get_or_create(username='op_autor')[0]
op_autor_user.set_password('interlegis') op_autor_user.set_password('interlegis')
op_autor_user.save()
op_autor.user_set.add(op_autor_user) op_autor.user_set.add(op_autor_user)
if __name__ == '__main__': if __name__ == '__main__':

Loading…
Cancel
Save