misc: add on_delete to foreign key (#41286)

This commit is contained in:
Frédéric Péters 2020-04-02 21:32:42 +02:00
parent 15ce4e23ea
commit bd09632404
2 changed files with 2 additions and 2 deletions

View File

@ -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,
),
]

View File

@ -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'))