mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-29 08:17:17 +00:00
perf: 优化截取方法
This commit is contained in:
parent
04ceca1b83
commit
c5bf4075e7
@ -2,6 +2,7 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from rest_framework import serializers
|
||||
|
||||
from common.utils import pretty_string
|
||||
from .models import AbstractSessionCommand
|
||||
|
||||
__all__ = ['SessionCommandSerializer', 'InsecureCommandAlertSerializer']
|
||||
@ -46,5 +47,5 @@ class SessionCommandSerializer(SimpleSessionCommandSerializer):
|
||||
|
||||
def validate_system_user(self, value):
|
||||
if len(value) > 64:
|
||||
value = value[:32] + value[-32:]
|
||||
value = pretty_string(value, 32)
|
||||
return value
|
||||
|
Loading…
Reference in New Issue
Block a user