fusionbox / django-widgy

A CMS framework for Django built on a heterogenous tree editor.
http://wid.gy
Other
332 stars 52 forks source link

Not all storage backends implement path #334

Closed j00bar closed 9 years ago

gavinwahl commented 9 years ago

Hi @j00bar,

Which backend doesn't? Is it possible to write a test to expose the bug?

Thanks

j00bar commented 9 years ago

https://github.com/django/django/blob/1.8/django/core/files/storage.py#L115

So unless a Storage implementation implements this, you'll get an error. This one doesn't:

https://bitbucket.org/david/django-storages/src/d26425cbfcb1f31b4e9259a09456c6a004f73c2d/storages/backends/s3boto.py?at=default#cl-194

Since you're only using path to get access to the file extension, the "name" attribute of the FieldFile should be sufficient.