mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [Paste submit] fix tags unpack
This commit is contained in:
parent
9898766ed7
commit
2cf419fc26
2 changed files with 7 additions and 7 deletions
|
@ -159,7 +159,10 @@ def get_item_tags_minimal(item_id):
|
||||||
|
|
||||||
def unpack_str_tags_list(str_tags_list):
|
def unpack_str_tags_list(str_tags_list):
|
||||||
str_tags_list = str_tags_list.replace('"','\"')
|
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
|
# TEMPLATE + API QUERY
|
||||||
|
|
|
@ -258,13 +258,10 @@ def submit():
|
||||||
|
|
||||||
if ltags or ltagsgalaxies:
|
if ltags or ltagsgalaxies:
|
||||||
|
|
||||||
ltags = ltags.split(',')
|
ltags = Tag.unpack_str_tags_list(ltags)
|
||||||
ltagsgalaxies = ltagsgalaxies.split(',')
|
ltagsgalaxies = Tag.unpack_str_tags_list(ltagsgalaxies)
|
||||||
|
|
||||||
print(ltags)
|
if not Tag.is_valid_tags_taxonomies_galaxy(ltags, ltagsgalaxies):
|
||||||
print(ltagsgalaxies)
|
|
||||||
|
|
||||||
if not Tags.is_valid_tags_taxonomies_galaxy(ltags, ltagsgalaxies):
|
|
||||||
content = 'INVALID TAGS'
|
content = 'INVALID TAGS'
|
||||||
print(content)
|
print(content)
|
||||||
return content, 400
|
return content, 400
|
||||||
|
|
Loading…
Reference in a new issue