Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Fix 120 #127

Merged
merged 1 commit into from
Mar 17, 2018
Merged

Fix 120 #127

merged 1 commit into from
Mar 17, 2018

Conversation

antonagestam
Copy link
Owner

@antonagestam antonagestam commented Mar 16, 2018

fixes #120


def is_boto3(storage):
return type(storage).__name__ == 'S3Boto3Storage'
return has_boto and isinstance(storage, S3Boto3Storage)
Copy link

@pachewise pachewise Mar 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this work if we didn't have boto/boto3 installed? (how do we test that)

edit: thinking through it, it should work, but I'm thinking we should cover that test case.

tested it locally, this works even if you don't have boto/boto3.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the isinstance(storage, S3Boto3Storage) will only get evaluated if has_boto is True, which will only happen if the import is successful. Would be good to test this but I think it might be a lot of effort.

@test
@override_django_settings(
STATICFILES_STORAGE="django.contrib.staticfiles.storage.StaticFilesStorage")
@override_setting("enabled", True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean for this to be False? (though I would say we also need to test this particular config)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pachewise Good find! Thanks for pointing that out! :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And that config is already tested in test_basics btw)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collectfast breaks with local filesystem storage even when disabled
2 participants