refactor: completely rewrite humanize_tags_from_json
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
f07a51f76a
commit
c70d7fe3be
1 changed files with 1 additions and 8 deletions
|
@ -3,14 +3,7 @@ import re
|
||||||
|
|
||||||
def humanize_tags_from_json(value: str, default: str) -> str:
|
def humanize_tags_from_json(value: str, default: str) -> str:
|
||||||
if value != "":
|
if value != "":
|
||||||
output = str()
|
return ", ".join([re.sub('_\\(.*', '', t) for t in value.split()])
|
||||||
tags = value.split()
|
|
||||||
|
|
||||||
for t in tags:
|
|
||||||
output += f"{re.sub('_\\(.*', '', t)}, "
|
|
||||||
output = output[:-2]
|
|
||||||
|
|
||||||
return output
|
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue