check if a is a dict or string
This commit is contained in:
parent
ba220d59c9
commit
19383ab9f3
1 changed files with 3 additions and 1 deletions
4
app.py
4
app.py
|
@ -370,7 +370,9 @@ def _is_img(filename):
|
|||
@app.template_filter()
|
||||
def not_only_imgs(attachment):
|
||||
for a in attachment:
|
||||
if not _is_img(a["url"]):
|
||||
if isinstance(a, dict) and not _is_img(a["url"]):
|
||||
return True
|
||||
if isinstance(a, str) and not _is_img(a):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue