misc: add on_delete to foreign key (#41286)
This commit is contained in:
parent
15ce4e23ea
commit
bd09632404
|
@ -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,
|
||||
),
|
||||
]
|
||||
|
|
|
@ -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'))
|
||||
|
|
Loading…
Reference in New Issue