diff --git a/etiquette/helpers.py b/etiquette/helpers.py index bcd80e4..ff4a04a 100644 --- a/etiquette/helpers.py +++ b/etiquette/helpers.py @@ -127,10 +127,12 @@ def chunk_sequence(sequence, chunk_length, allow_incomplete=True): return chunks -def comma_split(s): +def comma_space_split(s): ''' - Split the string apart by commas, discarding all extra whitespace and - blank phrases. + Split the string apart by commas and spaces, discarding all extra + whitespace and blank phrases. + + 'a b, c,,d' -> ['a', 'b', 'c', 'd'] ''' if s is None: return s diff --git a/etiquette/searchhelpers.py b/etiquette/searchhelpers.py index 54ee356..ac384fd 100644 --- a/etiquette/searchhelpers.py +++ b/etiquette/searchhelpers.py @@ -189,7 +189,7 @@ def normalize_authors(authors, photodb, warning_bag=None): return None if isinstance(authors, str): - authors = helpers.comma_split(authors) + authors = helpers.comma_space_split(authors) user_ids = set() for requested_author in authors: @@ -219,7 +219,7 @@ def normalize_extensions(extensions): return None if isinstance(extensions, str): - extensions = helpers.comma_split(extensions) + extensions = helpers.comma_space_split(extensions) if len(extensions) == 0: return None @@ -382,7 +382,7 @@ def normalize_tag_mmf(tags, photodb, warning_bag=None): return None if isinstance(tags, str): - tags = helpers.comma_split(tags) + tags = helpers.comma_space_split(tags) tagset = set() for tag in tags: