mirror of https://github.com/jumpserver/jumpserver
parent
30e51e37be
commit
995321cee9
|
@ -2,13 +2,13 @@
|
|||
#
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.exceptions import MethodNotAllowed
|
||||
from rest_framework.response import Response
|
||||
|
||||
from orgs.utils import tmp_to_root_org
|
||||
from rbac.permissions import RBACPermission
|
||||
from common.api import CommonApiMixin
|
||||
from common.const.http import POST, PUT, PATCH
|
||||
from orgs.utils import tmp_to_root_org
|
||||
from rbac.permissions import RBACPermission
|
||||
from tickets import filters
|
||||
from tickets import serializers
|
||||
from tickets.models import (
|
||||
|
@ -40,6 +40,14 @@ class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet):
|
|||
'open': 'tickets.view_ticket',
|
||||
}
|
||||
|
||||
|
||||
def retrieve(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
with tmp_to_root_org():
|
||||
serializer = self.get_serializer(instance)
|
||||
data = serializer.data
|
||||
return Response(data)
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
raise MethodNotAllowed(self.action)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue