Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Set ON DELETE SET NULL on User foreign keys
Marek Brzóskace6efee5e077
diff --git a/userprofile/models.py b/userprofile/models.pyindex fc5b067327..253a72939e 100644--- a/userprofile/models.py+++ b/userprofile/models.py@@ -83,10 +83,12 @@ class User(models.Model):editable=False)last_login = models.DateTimeField(_('last login'), default=timezone.now,editable=False)- default_shipping_address = models.ForeignKey(Address, related_name='+',- null=True, blank=True)- default_billing_address = models.ForeignKey(Address, related_name='+',- null=True, blank=True)+ default_shipping_address = models.ForeignKey(+ Address, related_name='+', null=True, blank=True,+ on_delete=models.SET_NULL)+ default_billing_address = models.ForeignKey(+ Address, related_name='+', null=True, blank=True,+ on_delete=models.SET_NULL)USERNAME_FIELD = 'email'