-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svg image stored as File object make folder list crash #1513
Comments
I've found 6 files of 585 which are SVG but stored as File |
does this happen with all SVG files or only specific ones? |
Just uploaded a svg-file with django-filer (3.1.3) in django-cms (4.1.4). On redirect after the upload to Reverse for 'filer_image_expand_view' not found. 'filer_image_expand_view' is not a valid view function or pattern name. Error during template rendering In template (...)\venv\Lib\site-packages\filer\templates\admin\filer\folder\directory_table_list.html, error at line 142
Searching for I made a quick and dirty dummy-test and everything worked as it should:
|
@fabien-michel Yes, I can see that miscategorised files are a problem. A solution might be to catch errors here: django-filer/filer/models/filemodels.py Lines 347 to 355 in 58b017d
Putting that in a Can I encourage you to create a PR? |
I don't know how it happened, but 4 years ago an svg file was uploaded using filer and it was stored in database as a File and not an Image object. (still has `'image/svg+xml' mime though)
Since "recent" modifications of filer, this situation make filer crash when trying to list the folder with this file.
It crash here
django-filer/filer/models/filemodels.py
Line 361 in 58b017d
because the
expand
admin url, does not exists in FileAdmin here:django-filer/filer/admin/fileadmin.py
Line 202 in 58b017d
Because the URL exists in ImageAdmin, and in normal scenario a SVG file is stored as an Image, it doesn't fail.
The text was updated successfully, but these errors were encountered: