use isinstance instead of type

pull/435/head
Andriy Zasypkin 7 years ago
parent fb41aa8b57
commit 6b4d7674b5
No known key found for this signature in database
GPG Key ID: 8686E6148F9D9BC2

@ -477,7 +477,7 @@ def yesno(value, yes, no):
@app.template_filter('canread') @app.template_filter('canread')
@app.template_test('canread') @app.template_test('canread')
def canread(ext): def canread(ext):
if type(ext) == db.Data: if isinstance(ext, db.Data):
ext = ext.format ext = ext.format
return ext.lower() in READER_EXTENSIONS return ext.lower() in READER_EXTENSIONS

Loading…
Cancel
Save