Remove multi-underscores from allowed names

This commit is contained in:
Beth Probert 2026-03-06 15:52:50 +00:00
parent 2c2f97cb56
commit 349485d43b
2 changed files with 31 additions and 1 deletions

View file

@ -353,6 +353,9 @@ class ScanDirectoryManager:
For more explanation on the scan naming see `new_scan_dir`
"""
scan_name = make_name_safe(scan_name)
# Strip all trailing underscores from the base name
scan_name = scan_name.strip("_")
# A regex with the scan name and a group for the numbers
scan_regex = re.compile(
"^" + scan_name + "_([0-9]{" + str(SCAN_ZERO_PAD_DIGITS) + "})$"