mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-11 04:09:45 +00:00
reactor&feat: 重构工单模块 & 支持申请应用工单 (#5352)
* reactor: 修改工单Model,添加工单迁移文件 * reactor: 修改工单Model,添加工单迁移文件 * reactor: 重构工单模块 * reactor: 重构工单模块2 * reactor: 重构工单模块3 * reactor: 重构工单模块4 * reactor: 重构工单模块5 * reactor: 重构工单模块6 * reactor: 重构工单模块7 * reactor: 重构工单模块8 * reactor: 重构工单模块9 * reactor: 重构工单模块10 * reactor: 重构工单模块11 * reactor: 重构工单模块12 * reactor: 重构工单模块13 * reactor: 重构工单模块14 * reactor: 重构工单模块15 * reactor: 重构工单模块16 * reactor: 重构工单模块17 * reactor: 重构工单模块18 * reactor: 重构工单模块19 * reactor: 重构工单模块20 * reactor: 重构工单模块21 * reactor: 重构工单模块22 * reactor: 重构工单模块23 * reactor: 重构工单模块24 * reactor: 重构工单模块25 * reactor: 重构工单模块26 * reactor: 重构工单模块27 * reactor: 重构工单模块28 * reactor: 重构工单模块29 * reactor: 重构工单模块30 * reactor: 重构工单模块31 * reactor: 重构工单模块32 * reactor: 重构工单模块33 * reactor: 重构工单模块34 * reactor: 重构工单模块35 * reactor: 重构工单模块36 * reactor: 重构工单模块37 * reactor: 重构工单模块38 * reactor: 重构工单模块39
This commit is contained in:
29
apps/tickets/api/assignee.py
Normal file
29
apps/tickets/api/assignee.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
from rest_framework import viewsets
|
||||
|
||||
from users.models import User
|
||||
from common.permissions import IsValidUser
|
||||
from common.exceptions import JMSException
|
||||
from orgs.utils import get_org_by_id
|
||||
from .. import serializers
|
||||
|
||||
|
||||
class AssigneeViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
permission_classes = (IsValidUser,)
|
||||
serializer_class = serializers.AssigneeSerializer
|
||||
filter_fields = ('id', 'name', 'username', 'email', 'source')
|
||||
search_fields = filter_fields
|
||||
|
||||
def get_org(self):
|
||||
org_id = self.request.query_params.get('org_id')
|
||||
org = get_org_by_id(org_id)
|
||||
if not org:
|
||||
raise JMSException('The organization `{}` does not exist'.format(org_id))
|
||||
return org
|
||||
|
||||
def get_queryset(self):
|
||||
org = self.get_org()
|
||||
queryset = User.get_super_and_org_admins(org=org)
|
||||
return queryset
|
Reference in New Issue
Block a user