diff --git a/membershipworks/tasks/ucsAccounts.py b/membershipworks/tasks/ucsAccounts.py index d3e90ec..b4fa567 100644 --- a/membershipworks/tasks/ucsAccounts.py +++ b/membershipworks/tasks/ucsAccounts.py @@ -22,7 +22,7 @@ GROUPS_REGEX = "|".join( # A group name must start and end with a letter, number or underscore. # In between additionally spaces, dashes and dots are allowed. def sanitize_group_name(name): - sanitized_body = re.sub(r"[^0-9A-Za-z_ -.]", ".", name) + sanitized_body = re.sub(r"[^0-9A-Za-z_ -.]+", ".", name) sanitized_start_end = re.sub("^[^0-9A-Za-z_]|[^0-9A-Za-z_]$", "_", sanitized_body) return "MW_" + sanitized_start_end