mirror of https://github.com/jumpserver/jumpserver
fix(tickets): 修复工单comment
parent
072c3155ca
commit
15992ad5b3
|
@ -6,7 +6,7 @@ from users.models.user import User
|
||||||
from common.serializers import AdaptedBulkListSerializer
|
from common.serializers import AdaptedBulkListSerializer
|
||||||
from common.drf.serializers import BulkModelSerializer
|
from common.drf.serializers import BulkModelSerializer
|
||||||
from common.db.models import concated_display as display
|
from common.db.models import concated_display as display
|
||||||
from .models import Organization, OrganizationMember, ROLE as ORG_ROLE
|
from .models import Organization, OrganizationMember
|
||||||
|
|
||||||
|
|
||||||
class OrgSerializer(ModelSerializer):
|
class OrgSerializer(ModelSerializer):
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import textwrap
|
||||||
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
|
@ -62,13 +64,13 @@ class RequestAssetPermTicketViewSet(JMSModelViewSet):
|
||||||
ips = ', '.join(meta.get('ips', []))
|
ips = ', '.join(meta.get('ips', []))
|
||||||
confirmed_assets = ', '.join(meta.get('confirmed_assets', []))
|
confirmed_assets = ', '.join(meta.get('confirmed_assets', []))
|
||||||
|
|
||||||
return f'''
|
return textwrap.dedent(f'''\
|
||||||
{_('IP group')}: {ips}
|
{_('IP group')}: {ips}
|
||||||
{_('Hostname')}: {meta.get('hostname', '')}
|
{_('Hostname')}: {meta.get('hostname', '')}
|
||||||
{_('System user')}: {meta.get('system_user', '')}
|
{_('System user')}: {meta.get('system_user', '')}
|
||||||
{_('Confirmed assets')}: {confirmed_assets}
|
{_('Confirmed assets')}: {confirmed_assets}
|
||||||
{_('Confirmed system user')}: {meta.get('confirmed_system_user', '')}
|
{_('Confirmed system user')}: {meta.get('confirmed_system_user', '')}
|
||||||
'''
|
''')
|
||||||
|
|
||||||
@action(detail=True, methods=[POST], permission_classes=[IsAssignee, IsValidUser])
|
@action(detail=True, methods=[POST], permission_classes=[IsAssignee, IsValidUser])
|
||||||
def reject(self, request, *args, **kwargs):
|
def reject(self, request, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue