Closed ykoasanto closed 6 years ago
It's intended to fix use of s3 but you've only modified code in the GoogleStorageMixin
class.
Is that right?
@stephenmcd: I modified two lines: 85 and 115 both is in S3BotoStorageMixin. I am just not familiar with the integration test to be able move forward, but I've been using this code in my fork and it's working fine so far.
Sorry I was looking at the wrong version of the file.
Also the tests are unrelated to your changes.
Thanks for the fix.
This should fix the issue described in https://github.com/stephenmcd/filebrowser-safe/issues/104 This is caused by mismatch of boto version. Django-storages has been updated to use boto3, while filebrowser-safe assumes that the
self.bucket
was created using boto2. The method s3.bucket.list exists only in boto2.The fix is to use listdir in S3Boto3Storage, which in turn is using
self.bucket.objects.filter(Prefix=self._encode_name(name))
to list the content of the bucketReference for methods supported in boto3 http://boto3.readthedocs.io/en/latest/reference/services/s3.html?highlight=s3#bucket
Reference for methods supported in boto2 http://boto.cloudhackers.com/en/latest/ref/s3.html#module-boto.s3.bucket