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,