Allow correspondents to be deleted without deleting their documents

Fixes #235
This commit is contained in:
Daniel Quinn committed 2017-07-15 19:13:10 +01:00
1 parent ede274386b
commit 347986a2b3
6 files changed
+82 -2

No files matched your search

+6 -1
View File
@@ -172,7 +172,12 @@ class Document(models.Model):
TYPES = (TYPE_PDF, TYPE_PNG, TYPE_JPG, TYPE_GIF, TYPE_TIF,)
correspondent = models.ForeignKey(
Correspondent, blank=True, null=True, related_name="documents")
Correspondent,
blank=True,
null=True,
related_name="documents",
on_delete=models.SET_NULL
)
title = models.CharField(max_length=128, blank=True, db_index=True)