Browse Source

Fix #2323 (#2324)

pull/2325/head
Victor Fabre 6 years ago
committed by GitHub
parent
commit
3230a6a8a2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      sapl/materia/migrations/0032_auto_20181022_1743.py
  2. 2
      sapl/materia/models.py

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

2
sapl/materia/models.py

@ -307,7 +307,7 @@ class MateriaLegislativa(models.Model):
class Autoria(models.Model): class Autoria(models.Model):
autor = models.ForeignKey(Autor, autor = models.ForeignKey(Autor,
verbose_name=_('Autor'), verbose_name=_('Autor'),
on_delete=models.CASCADE) on_delete=models.PROTECT)
materia = models.ForeignKey( materia = models.ForeignKey(
MateriaLegislativa, on_delete=models.CASCADE, MateriaLegislativa, on_delete=models.CASCADE,
verbose_name=_('Matéria Legislativa')) verbose_name=_('Matéria Legislativa'))

Loading…
Cancel
Save