mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-05 11:06:34 +00:00
fix: 修复工单流程设置显示其它组织问题
This commit is contained in:
parent
333bb64b8b
commit
889713f00e
@ -6,7 +6,8 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from users.models import User
|
from users.models import User
|
||||||
from common.mixins.models import CommonModelMixin
|
from common.mixins.models import CommonModelMixin
|
||||||
from orgs.mixins.models import OrgModelMixin
|
from orgs.mixins.models import OrgModelMixin
|
||||||
from orgs.utils import tmp_to_root_org, tmp_to_org, get_current_org_id
|
from orgs.models import Organization
|
||||||
|
from orgs.utils import tmp_to_org, get_current_org_id
|
||||||
from ..const import TicketType, TicketApprovalLevel, TicketApprovalStrategy
|
from ..const import TicketType, TicketApprovalLevel, TicketApprovalStrategy
|
||||||
|
|
||||||
__all__ = ['TicketFlow', 'ApprovalRule']
|
__all__ = ['TicketFlow', 'ApprovalRule']
|
||||||
@ -75,6 +76,7 @@ class TicketFlow(CommonModelMixin, OrgModelMixin):
|
|||||||
else:
|
else:
|
||||||
flows = cls.objects.all()
|
flows = cls.objects.all()
|
||||||
cur_flow_types = flows.values_list('type', flat=True)
|
cur_flow_types = flows.values_list('type', flat=True)
|
||||||
with tmp_to_root_org():
|
root_id = Organization.ROOT_ID
|
||||||
diff_global_flows = cls.objects.exclude(type__in=cur_flow_types)
|
with tmp_to_org(root_id):
|
||||||
|
diff_global_flows = cls.objects.exclude(type__in=cur_flow_types).filter(org_id=root_id)
|
||||||
return flows | diff_global_flows
|
return flows | diff_global_flows
|
||||||
|
Loading…
Reference in New Issue
Block a user