From 0d01e3a1daf608addb737101b073fd1890ba7c6a Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 12 May 2021 15:09:06 +0300 Subject: Stop using Sites, Django 3 fixes --- servo/models/account.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'servo/models/account.py') diff --git a/servo/models/account.py b/servo/models/account.py index d4549c6..b86c877 100644 --- a/servo/models/account.py +++ b/servo/models/account.py @@ -7,7 +7,7 @@ from django.conf import settings from pytz import common_timezones from django.core.cache import cache -from django.core.urlresolvers import reverse +from django.urls import reverse from rest_framework.authtoken.models import Token from mptt.fields import TreeForeignKey @@ -39,6 +39,7 @@ class User(AbstractUser): Customer, null=True, blank=True, + on_delete=models.SET_NULL, limit_choices_to={'is_company': True} ) @@ -55,7 +56,7 @@ class User(AbstractUser): Location, null=True, related_name='+', - on_delete=models.PROTECT, + on_delete=models.SET_NULL, verbose_name=_('Current Location'), help_text=_('Orders you create will be registered to this location.') ) -- cgit v1.2.3