From 00e8f112c1cdf8ff69ba8612668beb9f9718cd9d Mon Sep 17 00:00:00 2001 From: eribeiro Date: Tue, 2 Jun 2020 09:16:23 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20remover=20comiss=C3=A3o=20referencia?= =?UTF-8?q?da?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remover comissão referenciada por Composição e Participação. --- .../migrations/0024_auto_20200602_0915.py | 26 +++++++++++++++++++ sapl/comissoes/models.py | 4 +-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 sapl/comissoes/migrations/0024_auto_20200602_0915.py diff --git a/sapl/comissoes/migrations/0024_auto_20200602_0915.py b/sapl/comissoes/migrations/0024_auto_20200602_0915.py new file mode 100644 index 000000000..b51d9bd8f --- /dev/null +++ b/sapl/comissoes/migrations/0024_auto_20200602_0915.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-06-02 12:15 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('comissoes', '0023_auto_20191211_1752'), + ] + + operations = [ + migrations.AlterField( + model_name='composicao', + name='comissao', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comissoes.Comissao', verbose_name='Comissão'), + ), + migrations.AlterField( + model_name='participacao', + name='composicao', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='participacao_set', to='comissoes.Composicao', verbose_name='Composição'), + ), + ] diff --git a/sapl/comissoes/models.py b/sapl/comissoes/models.py index 8efac2ee6..9826c9848 100644 --- a/sapl/comissoes/models.py +++ b/sapl/comissoes/models.py @@ -141,7 +141,7 @@ class CargoComissao(models.Model): @reversion.register() class Composicao(models.Model): # IGNORE comissao = models.ForeignKey(Comissao, - on_delete=models.PROTECT, + on_delete=models.CASCADE, verbose_name=_('Comissão')) periodo = models.ForeignKey(Periodo, on_delete=models.PROTECT, @@ -160,7 +160,7 @@ class Composicao(models.Model): # IGNORE class Participacao(models.Model): # ComposicaoComissao composicao = models.ForeignKey(Composicao, related_name='participacao_set', - on_delete=models.PROTECT, + on_delete=models.CASCADE, verbose_name=_('Composição')) parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT,