widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #03761
Re: [Merge] lp:~franku/widelands-website/handle_big_images into lp:widelands-website
The whole weekend i tried to reproduce this on my maschine, but i never ran into this failure.
As i even noticed, it makes no sense to examine this issue on alpha, because all images are named like "/var/www/django_projects/.../image.png", and the safe_join() function compares with "/var/www/django_projects/alpha/../image.png" (additional "/alpha/"). So all comparison will result in a ValueError.
But this issue shows at least one thing we should take care of:
Restriction to 100 Characters:
"By default, ImageField instances are created as varchar(100) columns in your database. As with other fields, you can change the maximum length using the max_length argument." See https://docs.djangoproject.com/en/1.3/ref/models/fields/#django.db.models.ImageField
100 Characters isn't as much, as currently the whole path to the file is stored in this. So we should use the max_length attribute to change the length for future uploads.
Or use the Buildin Storageclass, which provide a "path" and "url" property. See https://docs.djangoproject.com/en/1.3/topics/files/
For now i will change this branch to prevent this failure. I think other things are more importand, f.e. https://code.launchpad.net/~hjd/widelands-website/django1.3.7/+merge/245447
--
https://code.launchpad.net/~franku/widelands-website/handle_big_images/+merge/247235
Your team Widelands Developers is subscribed to branch lp:widelands-website.
References