mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-28 16:16:41 +00:00
[Update] 修改资产主机名允许输入中文3
This commit is contained in:
@@ -94,7 +94,7 @@ class AssetSerializer(BulkOrgResourceModelSerializer):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_hostname(hostname):
|
def validate_hostname(hostname):
|
||||||
pattern = r"^[\._@a-zA-Z0-9-\u4e00-\u9fa5]+$"
|
pattern = r"^[\._@\w-]+$"
|
||||||
res = re.match(pattern, hostname)
|
res = re.match(pattern, hostname)
|
||||||
if res is None:
|
if res is None:
|
||||||
msg = _("* The hostname contains characters that are not allowed")
|
msg = _("* The hostname contains characters that are not allowed")
|
||||||
|
Reference in New Issue
Block a user