Merge pull request #3279 from jumpserver/dev_asset

[Update] 修改资产主机名匹配正则表达式
pull/3283/head
BaiJiangJie 2019-09-25 15:31:21 +08:00 committed by GitHub
commit a8c2a348aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class AssetSerializer(BulkOrgResourceModelSerializer):
@staticmethod
def validate_hostname(hostname):
pattern = r"^[\._@a-zA-Z0-9-\u4e00-\u9fa5]+$"
pattern = r"^[\._@\w-]+$"
res = re.match(pattern, hostname)
if res is None:
msg = _("* The hostname contains characters that are not allowed")