We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0f64496 + bcddb1e commit 842f5d9Copy full SHA for 842f5d9
aim/tests/unit/test_utils.py
@@ -39,6 +39,8 @@ def test_sanitize_display_name(self):
39
utils.sanitize_display_name('some' * 15))
40
41
def test_sanitize_description(self):
42
+ self.assertEqual(
43
+ '', utils.sanitize_description(None))
44
self.assertEqual(
45
'_eF5\\!#$%()*,-./:;@ _{|}~?&+_',
46
utils.sanitize_description('\'eF5\\!#$%()*,-./:;@ _{|}~?&+\"'))
aim/utils.py
@@ -21,5 +21,7 @@ def sanitize_display_name(display_name):
21
22
23
def sanitize_description(description):
24
+ if description is None:
25
+ return ''
26
return re.sub(r'[^a-zA-Z0-9\\!#$%()*,-./:;@ _{|}~?&+]',
27
'_', description[:124])
0 commit comments