fix: [Paste submit] fix tags unpack

pull/453/head
Terrtia 2019-12-02 17:15:48 +01:00
parent 9898766ed7
commit 2cf419fc26
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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