fix: 修复工单流bug 添加登陆审核配置

This commit is contained in:
feng626
2021-09-10 16:08:12 +08:00
committed by Jiangjie.Bai
parent bf6b685e8c
commit 345c0fcf4f
5 changed files with 235 additions and 120 deletions

View File

@@ -6,6 +6,7 @@ from django.utils.translation import ugettext_lazy as _
from common.mixins.models import CommonModelMixin
from common.db.encoder import ModelJSONFieldEncoder
from orgs.mixins.models import OrgModelMixin
from orgs.models import Organization
from orgs.utils import tmp_to_root_org
from ..const import TicketType, TicketApprovalLevel, TicketApprovalStrategy
from ..signals import post_or_update_change_ticket_flow_approval
@@ -67,5 +68,5 @@ class TicketFlow(CommonModelMixin, OrgModelMixin):
flows = cls.objects.all()
cur_flow_types = flows.values_list('type', flat=True)
with tmp_to_root_org():
diff_global_flows = cls.objects.exclude(type__in=cur_flow_types)
diff_global_flows = cls.objects.exclude(type__in=cur_flow_types).filter(org_id=Organization.ROOT_ID)
return flows | diff_global_flows