Unverified Commit a8c2a348 authored by BaiJiangJie's avatar BaiJiangJie Committed by GitHub

Merge pull request #3279 from jumpserver/dev_asset

[Update] 修改资产主机名匹配正则表达式
parents 26ef7b7b d7bc8516
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment