From 5295e88be1a5d3ac1aa94ae267d839e58cc92c5d Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 12 May 2021 15:32:50 +0300 Subject: Django 3 fixes --- servo/models/shipments.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'servo/models/shipments.py') diff --git a/servo/models/shipments.py b/servo/models/shipments.py index 614c642..9f93927 100644 --- a/servo/models/shipments.py +++ b/servo/models/shipments.py @@ -20,7 +20,9 @@ class Shipment(models.Model): RETURN_GPR = 2 # Good Part Return RETURN_CTS = 3 # Convert to stock - location = models.ForeignKey(Location, editable=False) + location = models.ForeignKey(Location, + editable=False, + on_delete=models.SET_NULL) ship_to = models.CharField( default='', @@ -81,6 +83,7 @@ class Shipment(models.Model): settings.AUTH_USER_MODEL, null=True, editable=False, + on_delete=models.SET_NULL, related_name='dispatched_shipments' ) -- cgit v1.2.3