mirror of https://github.com/CIRCL/AIL-framework
fix: [Paste submit] fix tags unpack
parent
9898766ed7
commit
2cf419fc26
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue