diff --git a/bin/packages/Tag.py b/bin/packages/Tag.py index 62a9b95f..d523bb9e 100755 --- a/bin/packages/Tag.py +++ b/bin/packages/Tag.py @@ -159,7 +159,10 @@ def get_item_tags_minimal(item_id): def unpack_str_tags_list(str_tags_list): str_tags_list = str_tags_list.replace('"','\"') - return str_tags_list.split(',') + if str_tags_list: + return str_tags_list.split(',') + else: + return [] # TEMPLATE + API QUERY diff --git a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py index 4af8fa0b..420e0bdf 100644 --- a/var/www/modules/PasteSubmit/Flask_PasteSubmit.py +++ b/var/www/modules/PasteSubmit/Flask_PasteSubmit.py @@ -258,13 +258,10 @@ def submit(): if ltags or ltagsgalaxies: - ltags = ltags.split(',') - ltagsgalaxies = ltagsgalaxies.split(',') + ltags = Tag.unpack_str_tags_list(ltags) + ltagsgalaxies = Tag.unpack_str_tags_list(ltagsgalaxies) - print(ltags) - print(ltagsgalaxies) - - if not Tags.is_valid_tags_taxonomies_galaxy(ltags, ltagsgalaxies): + if not Tag.is_valid_tags_taxonomies_galaxy(ltags, ltagsgalaxies): content = 'INVALID TAGS' print(content) return content, 400