aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models/shipments.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-05-12 15:32:50 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-05-12 15:32:50 +0300
commit5295e88be1a5d3ac1aa94ae267d839e58cc92c5d (patch)
tree174a55f5b8e41cb07114953fd4d1672c0f72b2b2 /servo/models/shipments.py
parentad45447445f5be4c14b4b11d798606748e0aa518 (diff)
downloadServo-5295e88be1a5d3ac1aa94ae267d839e58cc92c5d.tar.gz
Servo-5295e88be1a5d3ac1aa94ae267d839e58cc92c5d.tar.bz2
Servo-5295e88be1a5d3ac1aa94ae267d839e58cc92c5d.zip
Django 3 fixes
Diffstat (limited to 'servo/models/shipments.py')
-rw-r--r--servo/models/shipments.py5
1 files changed, 4 insertions, 1 deletions
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'
)