[Update] 修改get_current_org 为 proxy对象 current_org

This commit is contained in:
ibuler
2018-07-20 17:49:47 +08:00
parent b5f6f80ae6
commit e3aa18ff2d
18 changed files with 171 additions and 34 deletions

View File

@@ -16,7 +16,7 @@ from django.shortcuts import reverse
from common.utils import get_signer, date_expired_default
from common.models import Setting
from orgs.mixins import OrgManager
from orgs.utils import get_current_org
from orgs.utils import current_org
__all__ = ['User']
@@ -222,7 +222,6 @@ class User(AbstractUser):
self.role = 'Admin'
self.is_active = True
super().save(*args, **kwargs)
current_org = get_current_org()
if current_org and current_org.is_real():
self.orgs.add(current_org)