fix: since when str can't use is/is not
This commit is contained in:
parent
9ad1ce38ee
commit
b266a1a2df
3 changed files with 4 additions and 4 deletions
|
@ -6,14 +6,14 @@ from config import app
|
|||
|
||||
|
||||
def humanize_tags_from_json(value: str, default: str) -> str:
|
||||
if value is not "":
|
||||
if value != "":
|
||||
return ", ".join([re.sub("_\\(.*", "", t) for t in value.split()])
|
||||
return default
|
||||
|
||||
|
||||
def humanize_filesize(value: int) -> str:
|
||||
for unit in ["B", "KiB", "MiB", "GiB"]:
|
||||
if value < 1024 or unit is "GiB":
|
||||
if value < 1024 or unit == "GiB":
|
||||
break
|
||||
value /= 1024
|
||||
return f"{value:.2f} {unit}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue