Fix replaced - in allowed characters during object_id sanitizing (#5983)

This commit is contained in:
Jesse Hills authored and GitHub committed 2023-12-22 03:28:25 +13:00
1 parent 5e2df0b6a2
commit 442820deaf
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -357,7 +357,7 @@ def snake_case(value):
return value.replace(" ", "_").lower()
_DISALLOWED_CHARS = re.compile(r"[^a-zA-Z0-9_]")
_DISALLOWED_CHARS = re.compile(r"[^a-zA-Z0-9-_]")
def sanitize(value):
+1
View File
@@ -261,6 +261,7 @@ def test_snake_case(text, expected):
('!"§$%&/()=?foo_bar', "___________foo_bar"),
('foo_!"§$%&/()=?bar', "foo____________bar"),
('foo_bar!"§$%&/()=?', "foo_bar___________"),
('foo-bar!"§$%&/()=?', "foo-bar___________"),
),
)
def test_sanitize(text, expected):