mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
548 B
21 lines
548 B
3 years ago
|
from rest_framework.generics import RetrieveDestroyAPIView
|
||
|
|
||
|
from orgs.utils import tmp_to_root_org
|
||
|
from ..serializers import SuperTicketSerializer
|
||
|
from ..models import SuperTicket
|
||
|
|
||
|
|
||
|
__all__ = ['SuperTicketStatusAPI']
|
||
|
|
||
|
|
||
|
class SuperTicketStatusAPI(RetrieveDestroyAPIView):
|
||
|
serializer_class = SuperTicketSerializer
|
||
|
|
||
|
def get_queryset(self):
|
||
|
with tmp_to_root_org():
|
||
|
return SuperTicket.objects.all()
|
||
|
|
||
|
def perform_destroy(self, instance):
|
||
|
ticket = self.get_object()
|
||
|
ticket.close(processor=ticket.applicant)
|