mirror of https://github.com/jumpserver/jumpserver
commit
09160fed5d
|
@ -6,6 +6,8 @@ from rest_framework.permissions import AllowAny
|
||||||
|
|
||||||
from common.utils import get_logger
|
from common.utils import get_logger
|
||||||
from .. import errors, mixins
|
from .. import errors, mixins
|
||||||
|
from django.contrib.auth import logout as auth_logout
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['TicketStatusApi']
|
__all__ = ['TicketStatusApi']
|
||||||
logger = get_logger(__name__)
|
logger = get_logger(__name__)
|
||||||
|
@ -19,8 +21,11 @@ class TicketStatusApi(mixins.AuthMixin, APIView):
|
||||||
self.check_user_login_confirm()
|
self.check_user_login_confirm()
|
||||||
self.request.session['auth_third_party_done'] = 1
|
self.request.session['auth_third_party_done'] = 1
|
||||||
return Response({"msg": "ok"})
|
return Response({"msg": "ok"})
|
||||||
|
except errors.LoginConfirmOtherError as e:
|
||||||
|
self.send_auth_signal(success=False, user=request.user, username=request.user.name, reason=e.as_data().get('msg'))
|
||||||
|
auth_logout(request)
|
||||||
|
return Response(e.as_data(), status=200)
|
||||||
except errors.NeedMoreInfoError as e:
|
except errors.NeedMoreInfoError as e:
|
||||||
self.send_auth_signal(success=False, reason=e.as_data().get('msg'))
|
|
||||||
return Response(e.as_data(), status=200)
|
return Response(e.as_data(), status=200)
|
||||||
|
|
||||||
def delete(self, request, *args, **kwargs):
|
def delete(self, request, *args, **kwargs):
|
||||||
|
|
|
@ -15,7 +15,7 @@ p {
|
||||||
</style>
|
</style>
|
||||||
<div style="margin: 0 200px">
|
<div style="margin: 0 200px">
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<h2>JumpServer {% trans 'Client' %} v1.1.6</h2>
|
<h2>JumpServer {% trans 'Client' %} v1.1.7</h2>
|
||||||
<p>
|
<p>
|
||||||
{% trans 'JumpServer Client, currently used to launch the client, now only support launch RDP SSH client, The Telnet client will next' %}
|
{% trans 'JumpServer Client, currently used to launch the client, now only support launch RDP SSH client, The Telnet client will next' %}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -3,6 +3,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from orgs.models import Organization
|
from orgs.models import Organization
|
||||||
|
from orgs.utils import get_current_org_id
|
||||||
from orgs.mixins.serializers import OrgResourceModelSerializerMixin
|
from orgs.mixins.serializers import OrgResourceModelSerializerMixin
|
||||||
from tickets.models import TicketFlow, ApprovalRule
|
from tickets.models import TicketFlow, ApprovalRule
|
||||||
from tickets.const import TicketApprovalStrategy
|
from tickets.const import TicketApprovalStrategy
|
||||||
|
@ -96,7 +97,9 @@ class TicketFlowSerializer(OrgResourceModelSerializerMixin):
|
||||||
|
|
||||||
@atomic
|
@atomic
|
||||||
def update(self, instance, validated_data):
|
def update(self, instance, validated_data):
|
||||||
if instance.org_id == Organization.ROOT_ID:
|
current_org_id = get_current_org_id()
|
||||||
|
root_org_id = Organization.ROOT_ID
|
||||||
|
if instance.org_id == root_org_id and current_org_id != root_org_id:
|
||||||
instance = self.create(validated_data)
|
instance = self.create(validated_data)
|
||||||
else:
|
else:
|
||||||
instance = self.create_or_update('update', validated_data, instance)
|
instance = self.create_or_update('update', validated_data, instance)
|
||||||
|
|
Loading…
Reference in New Issue