mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-21 03:19:52 +00:00
perf(perms): 优化用户授权树返回org_name字段;添加thread_local属性org_mapper减少查询次数
This commit is contained in:
@@ -8,7 +8,7 @@ from django.core.exceptions import ValidationError
|
||||
from common.utils import get_logger
|
||||
from ..utils import (
|
||||
set_current_org, get_current_org, current_org,
|
||||
filter_org_queryset
|
||||
filter_org_queryset, get_org_name_by_id
|
||||
)
|
||||
from ..models import Organization
|
||||
|
||||
@@ -76,7 +76,7 @@ class OrgModelMixin(models.Model):
|
||||
|
||||
@property
|
||||
def org_name(self):
|
||||
return self.org.name
|
||||
return get_org_name_by_id(self.org_id)
|
||||
|
||||
@property
|
||||
def fullname(self, attr=None):
|
||||
|
Reference in New Issue
Block a user