Merge pull request #2287 from dabinat/label-validation

Label validation - Replace hyphens with spaces
This commit is contained in:
dabinat 2019-08-06 06:19:45 -07:00 committed by GitHub
commit 1cf2d6a8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,8 +92,9 @@ def validate_label(label):
if re.search(r"[0-9]|[(<\[\]&*{]", label) is not None:
return None
label = label.replace("-", "")
label = label.replace("_", "")
label = label.replace("-", " ")
label = label.replace("_", " ")
label = re.sub("[ ]{2,}", " ", label)
label = label.replace(".", "")
label = label.replace(",", "")
label = label.replace("?", "")