summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-04-02 19:32:42 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-04-02 19:33:55 (GMT)
commitbd09632404548293838cbe8fb55cf95a83f6e2f7 (patch)
tree77dbd7d9566b4f342ba772d39557b6f79ff964de
parent15ce4e23eaf1217f9be01a9930c187e797251ac1 (diff)
downloadwelco-bd09632404548293838cbe8fb55cf95a83f6e2f7.zip
welco-bd09632404548293838cbe8fb55cf95a83f6e2f7.tar.gz
welco-bd09632404548293838cbe8fb55cf95a83f6e2f7.tar.bz2
misc: add on_delete to foreign key (#41286)
-rw-r--r--welco/qualif/migrations/0001_initial.py2
-rw-r--r--welco/qualif/models.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/welco/qualif/migrations/0001_initial.py b/welco/qualif/migrations/0001_initial.py
index 89f8b96..0606fdd 100644
--- a/welco/qualif/migrations/0001_initial.py
+++ b/welco/qualif/migrations/0001_initial.py
@@ -56,7 +56,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='association',
name='source_type',
- field=models.ForeignKey(to='contenttypes.ContentType'),
+ field=models.ForeignKey(to='contenttypes.ContentType', on_delete=models.CASCADE),
preserve_default=True,
),
]
diff --git a/welco/qualif/models.py b/welco/qualif/models.py
index 8c563f1..a949611 100644
--- a/welco/qualif/models.py
+++ b/welco/qualif/models.py
@@ -24,7 +24,7 @@ from welco.utils import get_wcs_formdef_details, push_wcs_formdata, get_wcs_serv
class Association(models.Model):
- source_type = models.ForeignKey(ContentType)
+ source_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
source_pk = models.PositiveIntegerField()
source = GenericForeignKey('source_type', 'source_pk')
comments = models.TextField(blank=True, verbose_name=_('Comments'))