1 parent 33a0465 commit 02132ecCopy full SHA for 02132ec
1 file changed
catalog/models.py
@@ -71,7 +71,7 @@ class BookInstance(models.Model):
71
"""Model representing a specific copy of a book (i.e. that can be borrowed from the library)."""
72
id = models.UUIDField(primary_key=True, default=uuid.uuid4,
73
help_text="Unique ID for this particular book across whole library")
74
- book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True)
+ book = models.ForeignKey('Book', on_delete=models.RESTRICT)
75
imprint = models.CharField(max_length=200)
76
due_back = models.DateField(null=True, blank=True)
77
borrower = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True)
0 commit comments