djromero/django-thumbs — pull request #3 by bahoo (2013-05-14 05:52:14+00:00)
Title: Fixes a boto and django-storages error

I ran into an error when using boto with django-storages.

Digging deeper I discovered that django-storages tries deducing the content-type of the file, first by accessing a 'content_type' attribute on the thumbnail field, which in django-thumbs' case doesn't exist, so it's immediately directed through the __getattr__ magic, thinking it's a thumbnail size URL. See:

http://code.larlet.fr/django-storages/src/7b75212a27a56a7b261b7f2d43039b6ed7a57a91/storages/backends/s3boto.py?at=default#cl-381

To me it made sense to only try to parse a URL if "url_" occurs in the name of the attribute it's after, so I added a basic check before tearing down that path.