misc: don't crash on uploaded files with an unknown mime type (#27695)
This commit is contained in:
parent
5d1e59d7b6
commit
59886501f8
|
@ -699,6 +699,9 @@ class FileWithPreviewWidget(CompositeWidget):
|
|||
return False
|
||||
|
||||
filetype = (mimetypes.guess_type(temp.get('orig_filename', '')) or [''])[0]
|
||||
if not filetype:
|
||||
return False
|
||||
|
||||
if filetype == 'application/pdf':
|
||||
return HAS_GM
|
||||
|
||||
|
|
Loading…
Reference in New Issue