From 3230a6a8a29533865530546063df6768ea81269c Mon Sep 17 00:00:00 2001 From: Victor Fabre Date: Mon, 22 Oct 2018 18:25:50 -0300 Subject: [PATCH] Fix #2323 (#2324) --- .../migrations/0032_auto_20181022_1743.py | 21 +++++++++++++++++++ sapl/materia/models.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 sapl/materia/migrations/0032_auto_20181022_1743.py diff --git a/sapl/materia/migrations/0032_auto_20181022_1743.py b/sapl/materia/migrations/0032_auto_20181022_1743.py new file mode 100644 index 000000000..8721e831b --- /dev/null +++ b/sapl/materia/migrations/0032_auto_20181022_1743.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2018-10-22 20:43 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0031_auto_20180924_1724'), + ] + + operations = [ + migrations.AlterField( + model_name='autoria', + name='autor', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='base.Autor', verbose_name='Autor'), + ), + ] diff --git a/sapl/materia/models.py b/sapl/materia/models.py index dd9f8ddab..3c1b4862e 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -307,7 +307,7 @@ class MateriaLegislativa(models.Model): class Autoria(models.Model): autor = models.ForeignKey(Autor, verbose_name=_('Autor'), - on_delete=models.CASCADE) + on_delete=models.PROTECT) materia = models.ForeignKey( MateriaLegislativa, on_delete=models.CASCADE, verbose_name=_('Matéria Legislativa'))